iOS小效果(5)图片浏览器
来源:互联网 发布:崩坏学园2淘宝冲钻 编辑:程序博客网 时间:2024/04/30 06:35
iOS小效果(5)图片浏览器
核心代码:
-(void)viewDidLoad{ NSBundle *bundle=[NSBundle mainBundle]; NSString *path=[bundle pathForResource:@"descs" ofType:@"plist"]; // NSLog(@"%@",path); _allDescs =[NSArray arrayWithContentsOfFile:path]; _imageDesc.text=_allDescs[0];}- (IBAction)sliderValueChange:(UISlider *)sender{ //NSLog(@"%@---%d",sender,(int)sender.value); //[sender setMinimumValue:1.0]; //[sender setMaximumValue:16.0]; //更换图片 NSString *imageName=[NSString stringWithFormat:@"%d.png",(int)sender.value]; _imageView.image=[UIImage imageNamed:imageName]; //更换图片NO _imageNo.text=[NSString stringWithFormat:@"%d/16",(int)sender.value+1]; _imageDesc.text=_allDescs[(int)sender.value];}- (IBAction)setting:(UIButton *)sender{ [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; CGPoint tempCenter=_settingView.center; //tempCenter.y-=_settingView.frame.size.height; if(_settingView.frame.origin.y==self.view.frame.size.height) { tempCenter.y-=_settingView.bounds.size.height; }else { tempCenter.y+=_settingView.bounds.size.height; } _settingView.center=tempCenter; [UIView commitAnimations] ;}- (IBAction)imageSizeChange:(UISlider *)sender { _imageView.transform=CGAffineTransformMakeScale(sender.value, sender.value);}- (IBAction)nightMode:(UISwitch *)sender{ if (sender.on) { self.view.backgroundColor=[UIColor grayColor]; }else { self.view.backgroundColor=[UIColor whiteColor]; }}@end
plist 文件截图:
0 0
- iOS小效果(5)图片浏览器
- 【成长记录】iOS小程序图片浏览器
- iOS小效果(0)按钮控制图片的移动的方向
- iOS小效果(1)按钮控制图片的旋转的方向
- iOS小效果(2)按钮控制图片的放大缩小
- iOS小效果(3)按钮控制图片回到初始状态
- [iOS] 高仿 QQ、微信效果的图片浏览器(支持原图和缩略图、多种手势、CocoaPods)
- 跨浏览器图片灰度效果
- [iOS开发项目-5] 图片浏览器
- IOS开发------图片浏览器
- IOS 简易图片浏览器
- 仿ios 图片浏览器
- iOS 图片浏览器
- iOS 图片切换效果
- iOS 图片毛玻璃效果
- iOS图片模糊效果
- IOS图片叠加效果
- ios图片模糊效果
- android笔记--Intent和IntentFilter详解
- ASP.NET WAP开发概述
- IT行业令人向往的六大理由
- javascript和webui的交互
- Android蓝牙开发浅析 及 Android蓝牙通讯模块源码(Android蓝牙开发浅析 续)
- iOS小效果(5)图片浏览器
- The requested URL could not be retrieved
- C++注释Doxygen工具,注释的一般规范
- IOS 轻量级数据持久化 DataLite
- 下载nVelocity 视图模板引擎的注意事项
- c语言中各类型所占字节
- 这个JavaScript基础教程你绝对是值得看的
- 左右滑动菜单,模仿 ios智慧无锡 上的左右滑动菜单
- 程序员永远的痛之字符编码的奥秘