[置顶] ios 一个不错的图片浏览分享框架demo
demo功能:一个不错的图片浏览分享框架demo。iphone6.1 测试通过。可以浏览图片,保存,微博分享到新浪,腾讯,网易,人人等。
注:(由于各个微博的接口有时候会有调整,不一定能分享成功。只看框架,在找最新的官方分享接口将信息分享出去)
demo说明:主要代码在:PhotoViewController.m中。分享的各个接口在ShareSDK文件夹下。
框架用到了“SVProgressHUD” 第三方的控件来弹出提示层,提示 网络加载 或 提示对错。SVProgressHUD的具体说明;
和 “SDWebImage”类库来管理远程图片加载。SDWebImage的相关说明;
demo截屏:
demo主要代码: 主窗口布局部分
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = dNaviTitle;
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
self.navigationController.navigationBarHidden = YES;
self.navigationController.navigationBar.translucent = YES;
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
//self.navigationController.navigationBar.alpha = 0.5f;//将透明度设为50%。
UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
UIBarButtonItem *saveBarBtn = [[UIBarButtonItem alloc] initWithImage:dPicModuleImageSave style:UIBarButtonItemStylePlain target:self action:@selector(saveImage)];
UIBarButtonItem *spaceFlexItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
spaceFlexItem.width = 20.0;
//分享按钮
UIBarButtonItem *shareBarBtn = [[UIBarButtonItem alloc] initWithImage:dPicToolShare style:UIBarButtonItemStylePlain target:self action:@selector(shareImage)]; NSArray *barBtnArray = [NSArray arrayWithObjects:spaceItem, saveBarBtn, spaceFlexItem, shareBarBtn, nil];
[self setToolbarItems:barBtnArray];
self.navigationController.toolbar.tintColor = [UIColor blackColor];
self.navigationController.toolbar.translucent = YES;
self.navigationController.toolbarHidden = YES; [self setWantsFullScreenLayout:YES];
//图片数组
_imageURLArray = [[NSMutableArray alloc]initWithObjects:
@"http://jpp1.imghb.com/pic/pic/69/90/24/1410827669902478_a602x602.jpg",
@"http://jpp1.imghb.com/pic/pic/62/21/20/1396500062212039_a602x602.jpg",
@"http://jpp1.imghb.com/pic/pic/87/42/85/1405532187428506_a602x602.jpg",
@"http://jpp1.imghb.com/pic/pic/99/43/0/1392392199430020_a602x602.jpg",
@"http://jpp2.imghb.com/pic/pic/45/48/1/1399381845480110_a602x602.jpg",
@"http://jpp2.imghb.com/pic/pic/49/50/84/1407448049508416_a602x602.jpg",
@"http://jpp2.imghb.com/pic/pic/88/82/83/1402371388828392_a602x602.jpg",
@"http://jpp2.imghb.com/pic/pic/94/37/71/1401133494377186_a602x602.jpg",
@"http://jpp2.imghb.com/pic/pic/88/35/25/1401128288352593_a602x602.jpg", nil]; _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
[_scrollView setContentSize:CGSizeMake(320*[_imageURLArray count], 480)];
if ([UIScreen mainScreen].bounds.size.height >= 568)//iPhone5适配
{
_scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 568)];
[_scrollView setContentSize:CGSizeMake(320*[_imageURLArray count], 568)];
}
_scrollView.pagingEnabled = YES;//设为YES时,会按页滑动
_scrollView.bounces = NO;//取消UIScrollView的弹性属性,这个可以按个人喜好来定
[_scrollView setDelegate:self];//UIScrollView的delegate函数在本类中定义
_scrollView.showsHorizontalScrollIndicator = YES; _scrollView.minimumZoomScale=0.1;
_scrollView.maximumZoomScale=4.0; [self.view addSubview:_scrollView];
[self configScrowViewWithIndex:self.itemIndex withForward:NO withOrigin:YES];
pageIndex = itemIndex;
_isBarShown = NO;
}
demo下载地址:
http://download.csdn.net/download/donny_zhang/5693359
[置顶] ios 一个不错的图片浏览分享框架demo的更多相关文章
- [置顶] iOS学习笔记47——图片异步加载之EGOImageLoading
上次在<iOS学习笔记46——图片异步加载之SDWebImage>中介绍过一个开源的图片异步加载库,今天来介绍另外一个功能类似的EGOImageLoading,看名字知道,之前的一篇学习笔 ...
- [置顶] ios 在一定选项范围随机选取选项demo
原创文章,转载请注明出处:http://blog.csdn.net/donny_zhang/article/details/9408285 demo功能:ios 在一定范围随机选取demo,如截屏.在 ...
- 一个不错的图片滑动展示插件 anythingslider
一个不错的图片http://css-tricks.com/anythingslider-jquery-plugin/ DEMO演示: http://css-tricks.github.io/Anyth ...
- [置顶] ios 网页中图片点击放大效果demo
demo功能:点击网页中的图片,图片放大效果的demo.iphone6.1 测试通过. demo说明:通过webview的委托事件shouldStartLoadWithRequest来实现. demo ...
- [置顶] IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)
首先了解一下CGContextRef: An opaque type that represents a Quartz 2D drawing environment. Graphics Context ...
- [置顶] ios 时间定时器 NSTimer应用demo
原创文章,转载请注明出处:http://blog.csdn.net/donny_zhang/article/details/9251917 demo功能:ios NSTimer应用demo .ipho ...
- [置顶] ios App 中嵌入应用商店
昨晚同事拿了一个app 发现其app 内部页面打开了appstore 并没有唤起手机自带的appstore, 刚开始以为是用webview 加载的 ,可是自己些了一个demo 发现并不是那样一回事 用 ...
- [置顶] iOS 应用程序内部国际化,不跟随系统语言
前言:网络上关于iOS国际化的文章很多,但基本上都是基于跟随系统语言的国际化,笔者就不赘述了-0 – 今天要讲的是不跟随系统的切换语言版本方案,即程序内部的切换语言版本方案. 一.总则: 应用内部语言 ...
- [置顶] IOS培训资料
1 前言 今天给公司部门培训IOS,经过两天整理弄了个PPT和一个小的Demo,希望对大家入门有所帮助. 2 详述 培训内容,主要从开发环境讲起,到Objective-C的简单入门,IOS的简介,以及 ...
随机推荐
- openwrt 3g模块上网
硬件环境: 开发板为RT5053F 3G模块为中兴 MC2176 电信版 以下是操作步骤 加入VID .PID VID . PID 的获取方法是 将设备插入电脑在linux下执行 ...
- 二分查找(非递归JAVA)
庞果网编程英雄会上做的一道题:二分查找(非递归),和大家分享一下: public class BinarySearchClass { public static int binary_search(i ...
- Apache+windows server2008 外网访问配置
之前在一个服务器上部署一个apache网站,在局域网内都可以访问,但是外网始终访问不了,经常多次谷歌,把解决方案总结出来. 下面就默认部署apache自带的网站.系统:windows server20 ...
- Transparency Tutorial with C# - Part 2
Download Compositing Mode demo project - 24 Kb Download Compositing Mode source - 26 Kb Download Com ...
- 1.SQL统计某张表的列数。
select count(syscolumns.name) from syscolumns , sysobjects where syscolumns.id ...
- red hat Linux 使用CentOS yum源更新
red hat linux是商业版软件,没有经过注册是无法使用红帽 yum源更新软件的,使用CentOS源更新操作如下: 1.删除red hat linux 原有的yum 源 rpm -aq | gr ...
- svn rm --keep-local ./QueryParser_kill.logs
svn rm --keep-local ./QueryParser_kill.logs
- HDU - 2825 Wireless Password(AC自己主动机+DP)
Description Liyuan lives in a old apartment. One day, he suddenly found that there was a wireless ne ...
- 使用GraceNote Web API发展Mac发现音乐信息的应用
好久没有写博客,最近各种忙,特别忙里忙,今晚难得清闲.写最近完成下一个博客任务的摘要:使用GraceNote的Web API开发一个查询的音乐信息的应用,事实上,并在这些功能的前GraceNote S ...
- java Quartz定时器任务与Spring task定时的几种实现,
java Quartz定时器任务与Spring task定时的几种实现 基于java 的定时任务实现, Quartz 时间详细配置 请查阅 http://www.cnblogs.com/si ...