UiscrollView 简单使用
示例代码如下:
UIScrollView *scrView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width , self.view.frame.size.height)];
scrView.scrollEnabled = YES;
scrView.contentSize = CGSizeMake(self.view.frame.size.width*3,self.view.frame.size.height);
scrView.backgroundColor = [UIColor lightGrayColor];
[self.view addSubview:scrView];
UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, scrView.frame.size.height)];
[scrView addSubview:imgView];
UIImageView *imgView2 = [[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width, 0, scrView.frame.size.width, scrView.frame.size.height)];
[scrView addSubview:imgView2];
UIImageView *imgView3 = [[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width*2, 0, scrView.frame.size.width, scrView.frame.size.height)];
[scrView addSubview:imgView3];
imgView.image = [UIImage imageNamed:@"1"];
imgView2.image = [UIImage imageNamed:@"2"];
imgView3.image = [UIImage imageNamed:@"3"];
UiscrollView简单使用示例
本文介绍如何使用UiscrollView进行简单的滚动视图操作,包括代码示例、关键属性设置及基本布局实现。
2111

被折叠的 条评论
为什么被折叠?



