简体   繁体   English

如何在UIScrollView中执行垂直分页

[英]How can I do Vertical Paging in UIScrollView

Is it possible to do vertical scrolling without horizontal scrolling in UIScrollView? 是否可以在UIScrollView中进行垂直滚动而不进行水平滚动? How can I do this? 我怎样才能做到这一点?

The property pageEnabled should set to TRUE, for paging scroll. 对于分页滚动,属性pageEnabled应设置为TRUE。 The contentSize's width is as the same as view's width, and the height of contentSize set the value you desired. contentSize的宽度与视图的宽度相同,contentSize的高度设置您想要的值。 Then, it will do vertical scrolling, but no horizontal scrolling in UIScrollView. 然后,它将执行垂直滚动,但在UIScrollView中没有水平滚动。

You can read this sample coes, ScrollViewSuite . 你可以阅读这个示例coes, ScrollViewSuite Maybe there are something you need in the sample codes. 也许在示例代码中您需要一些东西。

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

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