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. oracle数据库、客户端安装以及ps/sql连接和导入表实例

    从下面的网址下载http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win32soft-098 ...

  2. MySQL HINT:Straight_JOIN

    来自生产环境的朋友.可能都会碰到:          原本运行良好的查询语句,过了一段时间后,可能会突然变得很糟糕     一个很大可能的原因就是数据分布情况发生了变化     从而导致MySQL优化 ...

  3. QLineEdit 自动完成(使用setCompleter,内含一个ListView)

    -------------------------------------CompleteLineEdit.h------------------------------------- #ifndef ...

  4. rm -vf `ls |egrep -v "info_20130826-180233.31764|QueryParser.INFO"`

    > rm -vf `ls |egrep -v "info_20130826-180233.31764|QueryParser.INFO"`

  5. Twitter僵尸帐号厂商雇佣中国员工专填验证码_Web2.0 - Microblogging 微博_cnBeta.COM

    Twitter僵尸帐号厂商雇佣中国员工专填验证码_Web2.0 - Microblogging 微博_cnBeta.COM Twitter僵尸帐号厂商雇佣中国员工专填验证码

  6. 【剑指offer】约瑟夫环问题

    转载请注明出处:http://blog.csdn.net/ns_code/article/details/27957407 题目描写叙述: 每年六一儿童节,JOBDU都会准备一些小礼物去看望孤儿院的小 ...

  7. Beijing Perl Workshop - Augest 10th, 2013

    Beijing Perl Workshop - Augest 10th, 2013 Beijing Perl Workshop

  8. Redis启动多端口,运行多实例(转)

    使用redis在同一台机器上,启用多个端口,实现多个实例,完成集群的模拟实现. 启动多实例 redis默认启动端口为6379,我们可以使用 --port 来指定多个端口,如下,在linux终端命令: ...

  9. java參数传递方式问题

    java的參数传递方式到底是值传递还是引用传递,这一直是一个争论不休的问题,一直以来没有形成统一意见. 在这里,我也仅仅是说一说个人见解,不保证是对的,全当是抛砖引玉. 首先我的观点是java採用的是 ...

  10. SWT的ListVierer的使用

    package com.test; import java.util.ArrayList; import java.util.List; import model.People; import org ...