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. ANDROID L——Material Design综合应用(Demo)

    转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! Material Design: Material Design是Google推出的一个全 ...

  2. Java 螺纹第三版 第一章Thread介绍、 第二章Thread创建和管理学习笔记

    第一章 Thread导论 为何要用Thread ? 非堵塞I/O      I/O多路技术      轮询(polling)      信号 警告(Alarm)和定时器(Timer) 独立的任务(Ta ...

  3. Delphi 的绘图功能(29篇博客)

    http://www.cnblogs.com/del/category/123038.html

  4. table显示边框问题,隐藏行线,列线

    只显示上边框 <table frame=above> 只显示下边框 <table frame=below> 只显示左.右边框 <table frame=vsides> ...

  5. 图像编程学习笔记1——bmp文件结构处理与显示

    文本内容转载自<数字图像处理编程入门>,代码为自己实现 1.1图和调色板的概念 如今Windows(3.x以及95,98,NT)系列已经成为绝大多数用户使用的操作系统,它比DOS成功的一个 ...

  6. 一致性哈希算法(consistent hashing)样例+測试。

    一个简单的consistent hashing的样例,非常easy理解. 首先有一个设备类,定义了机器名和ip: public class Cache { public String name; pu ...

  7. 在 window7 window8下公布webService注意问题

    李石磊 学习日记 错误形如: 解决方式: 1.将服务公布,在IIS下创建虚拟文件夹 2.为上面创建的虚拟文件夹创建单独的应用程序,方法是右击虚拟文件夹.点击"加入应用程序...", ...

  8. ssl https双向验证的配置与证书库的生成

    1.SSL认证 不须要特别配置,相关证书库生成看https认证中的相关部分 2.HTTPS认证 一.基本概念 1.单向认证,就是传输的数据加密过了,可是不会校验client的来源  2.双向认证,假设 ...

  9. [置顶] ANDROID 返回,菜单和HOME键的监听

    ------网上找了很多资料,项目中使用,最后将经验总结如下: 1,返回和菜单键是可以直接重写onKeyDown(int keyCode, KeyEvent event) 方法监听: @Overrid ...

  10. HDU 1226 超级密码 (搜素)

    题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1226 题意简单,本来是一道很简单的搜素题目. 但是有两个bug: 1.M个整数可能有重复的. 2.N可 ...