【发布时间】:2014-03-22 15:53:03
【问题描述】:
我在我的应用程序中处理UIScrollView。我已经设置了 delegate ,但是当我在垂直向下方向滚动滚动视图时,它的 contentOffset.y 始终为零。我正在开发 ios7 模拟器。我不明白为什么会出现这个问题?有人有解决办法吗?
if (!scrollView) {
self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-70)];
self.scrollView.backgroundColor = [UIColor whiteColor];
self.scrollView.delegate = self;
self.scrollView.contentOffset = CGPointMake(0, 0);
[self.view addSubview:self.scrollView];
}
谢谢
【问题讨论】:
-
if (!scrollView) { self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height -70)]; self.scrollView.backgroundColor = [UIColor whiteColor]; self.scrollView.delegate = self; self.scrollView.contentOffset = CGPointMake(0, 0); [self.view addSubview:self.scrollView]; }
-
[self.scrollView setContentSize:CGSizeMake(320, yAxis+100)];
-
编辑你的问题,不要放在评论里
-
这里没有响应滚动视图中滚动的内容。
标签: ios7 uiscrollview ios-simulator