我在使用 UIScrollView 时遇到了一些问题。我创建了它,设置了一些属性,并使用主视图指向这个 UIScrollView.See:
scrollWidth = 320.0;
scrollHeight = 410 * listRegisterPeople.count;
scrollScreenView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, scrollWidth, scrollHeight)];
[scrollScreenView setScrollEnabled:YES];
[scrollScreenView setContentSize:CGSizeMake(scrollWidth, 410 * list.count)];
[scrollScreenView setShowsVerticalScrollIndicator:YES];
[scrollScreenView setShowsHorizontalScrollIndicator:YES];
[scrollScreenView setPagingEnabled:NO];
scrollScreenView.delegate = self;
[scrollScreenView setContentOffset:CGPointMake(0, 0)];
self.view = scrollScreenView;
但我想将 scrollScreenView 添加为子视图 [self.view addSubview:scrollScreenView]。但是通过这种方式,我无法滚动我的视图,我不知道为什么。. .
如何解决?