2
我有一个UIScrollView,我在其中显示推文。 scrollView包含在一堆视图中,其中最后一个有4个手势识别器。UIScrollView没有响应触摸
- (void) createTimeLine:(NSArray*)timeline
{
CGRect rect = CGRectMake(0, 0, 463, 150);
NSInteger i = 0;
NSLog(@"timeline objects: %d", timeline.count);
self.scrollView.contentSize = CGSizeMake(463, timeline.count * 150);
for (NSDictionary *d in timeline) {
SingleTwitViewController *c = [[SingleTwitViewController alloc] initWithAsingleTwit:d];
rect.origin.y = i * 150;
c.view.frame = rect;
[scrollView addSubview:c.view];
[scrollView bringSubviewToFront:c.view];
i += 1;
}
}
有在时间轴20个对象,并且所述第一4是可见的:
滚动视图如下填充。但是,scrollView不会滚动,手势识别者操纵触摸。
scrollEnabled
属性设置为YES,但由于某种原因,这似乎不起作用。
contentSize设置为463 * 3000,它比它自己的scrollView小得多,但它仍然不会滚动。
任何想法?
你的'userInteractionEnable'设为对于你的scrollView和你的子视图来说是YES? – MaTTP