0
내 UIScrollView
에 대해 동적으로 하위보기 (페이지)를 만들 수 있는지 궁금합니다. 난 단지 2가 필요합니다 UILabel
. 하나는 상단에, 하나는 하단에 있습니다. 가능하다면 누군가가 내게 어떻게 말해 주거나 튜토리얼/비디오를 가르쳐 줄 수 있습니까?동적 uiscrollview 하위보기 만들기
나는 튜토리얼을 사용했고, 나는 아주 좋아졌다. 그러나 하단에는 1 UILabel
만 있습니다. 그 링크는 여기에 있습니다 http://www.iosdevnotes.com/2011/03/uiscrollview-paging/
이것은 대부분의 행동이라고 생각합니다.
_objects = [[NSArray alloc] initWithObjects:@"",@"Does not include today", @"This does include today", @"Does not include today", @"This does include today", @"Includes the weekends!", nil];
_detailLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(100.0, 0.0, 320.0, 460.0)];
_detailLabel1.textAlignment = UITextAlignmentCenter;
_detailLabel1.font = [UIFont boldSystemFontOfSize:15.0];
_detailLabel1.textColor=[UIColor whiteColor];
_detailLabel1.backgroundColor=[UIColor colorWithWhite:(CGFloat)1 alpha:(CGFloat)0];
_detailLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(320.0, 0.0, 320.0, 460.0)];
_detailLabel2.textAlignment = UITextAlignmentCenter;
_detailLabel2.font = [UIFont boldSystemFontOfSize:15.0];
_detailLabel2.textColor=[UIColor whiteColor];
_detailLabel2.backgroundColor=[UIColor colorWithWhite:(CGFloat)1 alpha:(CGFloat)0];
_detailLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(640.0, 0.0, 320.0, 460.0)];
_detailLabel3.textAlignment = UITextAlignmentCenter;
_detailLabel3.font = [UIFont boldSystemFontOfSize:15.0];
_detailLabel3.textColor=[UIColor whiteColor];
_detailLabel3.backgroundColor=[UIColor colorWithWhite:(CGFloat)1 alpha:(CGFloat)0];
// We are going to show all the contents of the _objects array
// using only these three UILabel instances, making them jump
// right and left, replacing them as required:
[scrollView addSubview:_detailLabel1];
[scrollView addSubview:_detailLabel2];
[scrollView addSubview:_detailLabel3];
다른 곳에서는 다른 코드가 있지만 여기에는 그 주요 부분이 있다고 생각합니다.