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的更多相关文章

  1. [置顶] iOS学习笔记47——图片异步加载之EGOImageLoading

    上次在<iOS学习笔记46——图片异步加载之SDWebImage>中介绍过一个开源的图片异步加载库,今天来介绍另外一个功能类似的EGOImageLoading,看名字知道,之前的一篇学习笔 ...

  2. [置顶] ios 在一定选项范围随机选取选项demo

    原创文章,转载请注明出处:http://blog.csdn.net/donny_zhang/article/details/9408285 demo功能:ios 在一定范围随机选取demo,如截屏.在 ...

  3. 一个不错的图片滑动展示插件 anythingslider

    一个不错的图片http://css-tricks.com/anythingslider-jquery-plugin/ DEMO演示: http://css-tricks.github.io/Anyth ...

  4. [置顶] ios 网页中图片点击放大效果demo

    demo功能:点击网页中的图片,图片放大效果的demo.iphone6.1 测试通过. demo说明:通过webview的委托事件shouldStartLoadWithRequest来实现. demo ...

  5. [置顶] IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)

    首先了解一下CGContextRef: An opaque type that represents a Quartz 2D drawing environment. Graphics Context ...

  6. [置顶] ios 时间定时器 NSTimer应用demo

    原创文章,转载请注明出处:http://blog.csdn.net/donny_zhang/article/details/9251917 demo功能:ios NSTimer应用demo .ipho ...

  7. [置顶] ios App 中嵌入应用商店

    昨晚同事拿了一个app 发现其app 内部页面打开了appstore 并没有唤起手机自带的appstore, 刚开始以为是用webview 加载的 ,可是自己些了一个demo 发现并不是那样一回事 用 ...

  8. [置顶] iOS 应用程序内部国际化,不跟随系统语言

    前言:网络上关于iOS国际化的文章很多,但基本上都是基于跟随系统语言的国际化,笔者就不赘述了-0 – 今天要讲的是不跟随系统的切换语言版本方案,即程序内部的切换语言版本方案. 一.总则: 应用内部语言 ...

  9. [置顶] IOS培训资料

    1 前言 今天给公司部门培训IOS,经过两天整理弄了个PPT和一个小的Demo,希望对大家入门有所帮助. 2 详述 培训内容,主要从开发环境讲起,到Objective-C的简单入门,IOS的简介,以及 ...

随机推荐

  1. LCA 最近公共祖先 tarjan离线 总结 结合3个例题

    在网上找了一些对tarjan算法解释较好的文章 并加入了自己的理解 LCA(Least Common Ancestor),顾名思义,是指在一棵树中,距离两个点最近的两者的公共节点.也就是说,在两个点通 ...

  2. winform下载网页代码

    1:webClient client=new WebClient(); client.Downloadstring(地址) client.Downloadfile(地址,保存路径) 2:后台线程dow ...

  3. 各种oracle10g下载地址(官网网页上好像找不到了)

    Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit ...

  4. UVa 11988 - Broken Keyboard (a.k.a. Beiju Text) 题解

    刘汝佳的题目,悲剧文本 -_-||| 这里使用vector<string>容器倒置记录数据,然后从后面输出就能够了. 难度就是不知道这种文档究竟哪里是開始输出,故此使用动态管理内存的容器比 ...

  5. CentOS 7 安装MySql Server 5.6

    1. 安装MySql Server 在/etc/yum.repos.d/目录下添加以下文件mysql-community.repo文件,内容如下: [mysql56-community] name=M ...

  6. poj3237(树链剖分)

    题目链接:http://poj.org/problem?id=3237 题目大意:指定一颗树上有3个操作: 1)询问操作,询问a点和b点之间的路径上最长的那条边的长度(即最大值): 2)取反操作,将a ...

  7. cocos2d-x快乐的做让人快乐的游戏3:cocos-2d 3.x中的物理世界

    Cocos2d-x 3.0+ 中全新的封装的物理引擎给了开发人员最大的便捷,你不用再繁琐与各种物理引擎的细节,全然的封装让开发人员能够更快更好的将物理引擎的机制加入�到自己的游戏中,简化的设计是从2. ...

  8. iOS_16_开关控制器_modal_代码方法

    最后效果图: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcHJlX2VtaW5lbnQ=/font/5a6L5L2T/fontsize/400/fill ...

  9. ASP.NET管线与应用程序生命周期

    ASP.NET管线与应用程序生命周期 ASP.NET管线与应用程序生命周期 8.1节介绍了IIS的系统架构和HTTP请求处理的总体流程,从中可以知道每个ASP.NET网站都对应着一个Web应用程序,此 ...

  10. libgdx如何调用android平台内容

    使用libgdx已经有一段时间了.最近经常有朋友问我如何在libgdx中调用android的内容. 正常来说libgdx是跨平台的,gdx中的代码是不允许有任何其他平台的相关代码,但实际使用时经常会有 ...