Scroll View

iOS 2013.05.18 17:36


self.scroll_view.contentSize = CGSizeMake(320*4, 568);


UIImageView * image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"anna.jpg"]];

[image1 setFrame:CGRectMake(320*0, 0, 320, 568);


UIImageView *image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"anna2.jpg"]];

[image2 setFrame:CGRectMake(320*1, 0, 320, 568);


UIImageView * image3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"anna3.jpg"]];

[image3 setFrame:CGRectMake(320*2, 0, 320, 568);


UIImageView *image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"anna2.jpg"]];

[image4 setFrame:CGRectMake(320*3, 0, 320, 568); 


[self.image_view addSubview:image1];

[self.image_view addSubview:image2];

[self.image_view addSubview:image3];

[self.image_view addSubview:image4];




참고자료




'iOS' 카테고리의 다른 글

<데이터베이스>db에 있는 데이터를 tableView로 보여주기  (0) 2013.05.18
controller 전환하기  (0) 2013.05.18
Scroll View  (0) 2013.05.18
View 변환하기.  (0) 2013.05.18
CGRect를 이용한 애니메이션  (0) 2013.05.18
image view에 새 이미지 설정하기.  (0) 2013.05.18
Posted by 하남각목