简体   繁体   English

UIScroll view内的UITableview-触摸tableview时禁用scrollview滚动

[英]UITableview inside UIScroll view - Disable scroll of scrollview when touching tableview

I have a UITableview which is added as a subview to the uiscrollview. 我有一个UITableview作为子视图添加到uiscrollview。 The table view Iam making it horizontal by rotating. 表格视图Iam通过旋转使其变为水平。 So I can scroll the tableview horizontally. 因此,我可以水平滚动tableview。 And my scrollview itself a horizontal scroll is there. 我的scrollview本身是一个水平滚动。 Now the problem is when Iam scrolling my tableview, and reached last row, it is scrolling the Scrollview itself. 现在的问题是当Iam滚动我的表视图并到达最后一行时,它正在滚动Scrollview本身。 I wnt to disable the scroll of the scrollview when Iam touching the Tableview. 我要在触摸Tableview时禁用scrollview的滚动。 How can I do this? 我怎样才能做到这一点?

Decrees the content height of uiscrollview 裁定uiscrollview的内容高度

[scrollView setContentSize:CGSizeMake(scrollView.contentSize.width, 200)];

you can set height of tableview instead of 200. 您可以设置表格视图的高度,而不是200。

您可以将TableView放在另一个ScrollView上,然后在使用内部滚动视图时,将outterScrollView scrollingEnabled设置为NO。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM