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. ThinkPHP框架模型连贯操作(八)

    原文:ThinkPHP框架模型连贯操作(八) Thinkphp的连贯操作使用起来也是很灵活: *可能这里有的mysql函数没全部罗列出来,大家可以举一反三,形式雷同 一.常用连贯操作 1.where ...

  2. 使用ROW_NUMBER()查询:列名 'RowNumber' 无效。

    原文:使用ROW_NUMBER()查询:列名 'RowNumber' 无效. 使用ROW_NUMBER()方法查询结果集:语句如下:   select ROW_NUMBER() OVER(ORDER ...

  3. leetcode解析回文子串拆分

    转载请注明来自souldak,微博:@evagle Given a string s, partition s such that every substring of the partition i ...

  4. SVN最有效的方法打基线

    笔者:张克强    在微博上:张克强-敏捷307 2014/7/6 方法一来自于我的一条微博: 组织级scm建一个名为controlled的文件夹,当项目某文档通过评审后,组织级scm从项目文件夹下找 ...

  5. Java生成目录

    Java生成目录 1.说明 推断目录是否存在,假设不存在就创建该目录.并打印其路径.假设存在,打印其路径 2.实现源代码 /** * @Title:BuildFolder.java * @Packag ...

  6. Thrift搭建分布式微服务1

    Thrift搭建分布式微服务 一.Thrift是什么? 关于Thrift的基本介绍,参看张善友的文章Thrift简介. 二.为什么使用微服务? 在公司的高速发展过程中,随着业务的增长,子系统越来越多. ...

  7. Android bluetooth介绍(四): a2dp connect流程分析

    关键词:蓝牙blueZ  A2DP.SINK.sink_connect.sink_disconnect.sink_suspend.sink_resume.sink_is_connected.sink_ ...

  8. IE浏览器审查密码的清除

    上周去188工业区,总装厂的喷油部的电脑上被谁设置了IE的审查密码,后来通过电话沟通,运维岗给出了具体的解决方法: 进入注册表HKEY_LOCAL_MACHINE\Software\Microsoft ...

  9. java api例子网站

    http://www.programcreek.com/java-api-examples/ http://www.apihome.cn/api/list/ http://www.docjar.com ...

  10. Mysql加入用户时的错误问题

    比如:加入用户 insert into mysql.user(Host,User,Password) values("localhost","test",pas ...