吉吉于

iOS学习笔记(6):滚动视图

下载源码

- (void)viewDidLoad
{
    [super viewDidLoad];
    _scrollView.contentSize=CGSizeMake(320*5, 425.);
    for(int i=1;i<=5;i++){
        UIImageView *imgView=[[[UIImageView alloc]initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.jpg",i]]] autorelease];
        imgView.frame=CGRectMake((i-1)*320, 0.0, 320.0, 425.0);
        [_scrollView addSubview:imgView];

    }
	// Do any additional setup after loading the view, typically from a nib.
}

 

转载请注明:于哲的博客 » iOS学习笔记(6):滚动视图