9
我不能讓我的滾動視圖實際滾動。一切顯示正常,除了它只是不會滾動.....下面是我的代碼:iPhone SDK:的UIScrollView不滾動
- (void)viewDidLoad {
[super viewDidLoad];
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 600)];
scrollView.contentSize = CGSizeMake(320, 600);
scrollView.scrollEnabled = YES;
scrollView.clipsToBounds = YES;
[self.view addSubview:scrollView];
planView = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView2 = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView2.frame = CGRectMake(0, 164, 320, 165);
planView3 = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView3.frame = CGRectMake(0, 328, 320, 165);
planView4 = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView4.frame = CGRectMake(0, 505, 320, 165);
[scrollView addSubview:planView];
[scrollView addSubview:planView2];
[scrollView addSubview:planView3];
[scrollView addSubview:planView4];
}
我該如何解決這個問題?
趕上pop850。加一! – ouflak 2015-09-28 12:47:08