图片浏览器
来源:互联网 发布:crc知乎 编辑:程序博客网 时间:2024/05/29 10:57
=
#import "CHViewController.h"@interface CHViewController (){ NSArray *_allDescs;}@end@implementation CHViewController- (void)viewDidLoad{ [super viewDidLoad];// Do any additional setup after loading the view, typically from a nib. //设置图片描述 NSBundle *bundle = [NSBundle mainBundle]; NSString *path = [bundle pathForResource:@"descs" ofType:@"plist"]; _allDescs = [NSArray arrayWithContentsOfFile:path];//因为只需要加载一次就可以 NSLog(@"%@",_allDescs); _imageDesc.text = _allDescs[0];}- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}# pragma mark 点击设置按钮- (IBAction)nightMode:(UISwitch *)sender { if(sender.on){ self.view.backgroundColor = [UIColor darkGrayColor]; }else{ self.view.backgroundColor = [UIColor whiteColor]; }}# pragma mark 对图像进行缩放- (IBAction)imageSizeChange:(UISlider *)sender { //修改大小三种方式:frame bounds transform [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.4]; CGFloat scale = sender.value; //NSLog(@"%f",scale); _imageView.transform = CGAffineTransformMakeScale(scale, scale); [UIView commitAnimations];}# pragma mark 控制设置view的上下- (IBAction)setting { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; CGPoint tempCenter = _settingView.center; //NSLog(@"%@",tempCenter); if(_settingView.frame.origin.y == self.view.frame.size.height){ tempCenter.y -= _settingView.bounds.size.height; //NSLog(@"%@",tempCenter.x); }else{ tempCenter.y += _settingView.bounds.size.height; } _settingView.center = tempCenter; [UIView commitAnimations];}# pragma mark slide值的改变- (IBAction)sliderValueChange:(UISlider *)sender { int location = (int)sender.value; //设置图片 NSString *imageNamed = [NSString stringWithFormat:@"mg%d.jpg",location]; _imageView.image = [UIImage imageNamed:imageNamed]; //_imageView setImage:(UIImage *) //设置图片序号 NSString *imageNo = [NSString stringWithFormat:@"%d/6",location]; _imageNo.text = imageNo; //设置描述 int descNo = location - 1; //NSLog(@"%d--%@",no,allDescs[no]); _imageDesc.text = _allDescs[descNo]; NSLog(@"%f--%d--%@",sender.value,(int)sender.value,_allDescs[descNo]);}@end
0 0
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 图片浏览器
- 小巧工具--图片浏览器
- 用浏览器浏览图片
- VB制作图片浏览器
- js 图片切换浏览器
- [VB.NET]图片浏览器
- 手机浏览器图片显示
- 简单的图片浏览器
- Js图片浏览器
- Jsp+Servlet+JavaBean经典MVC模式理解
- hdu 4587 2013南京邀请赛B题/ / 求割点后连通分量数变形。
- SDK安装的其中一种让人抓狂的错误
- 模板引擎freemarker的简单使用教程
- oracle 3个实用sql场景
- 图片浏览器
- 黑马程序员----------高新技术之内部类及其应用
- IO流的打印流、序列流其他流总结
- LR杂记--Loadrunner分析系统资源
- C - Sereja and Suffixes
- 不安装oracle使用PL/SQL Developer
- HDU 2553 N皇后问题 (搜索DFS)
- LR 杂记--LoadRunner的协议学习
- 客户端服务器结构网络通信