Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:SetContentOffset for Scrollview不';行不通_Ios_Uiscrollview_Contentoffset - Fatal编程技术网

iOS:SetContentOffset for Scrollview不';行不通

iOS:SetContentOffset for Scrollview不';行不通,ios,uiscrollview,contentoffset,Ios,Uiscrollview,Contentoffset,我有3个滚动视图,他们应该滚动同步与其他 但是这个代码不起作用: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [rowIdCellScrollView setContentOffset:CGPointMake(0, contentScrollView.contentOffset.y)]; [headerScrollView setContentOffset:CGPointMake(contentScrollView.conte

我有3个滚动视图,他们应该滚动同步与其他

但是这个代码不起作用:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
[rowIdCellScrollView setContentOffset:CGPointMake(0, contentScrollView.contentOffset.y)];
[headerScrollView setContentOffset:CGPointMake(contentScrollView.contentOffset.x, 0)];
}

您有UIScrollViewDelegate吗?并设置了玛瑙:

rowIdCellScrollView.delegate = self;

这个scrollViewDidScroll调用了吗

我找到了解决方案,问题是,我在LayoutSubView中初始化了组件