问题描述
我一直在制作一个在 UIViewControllers
之间滚动的示例应用程序,但重点是我想在滚动结束时以及返回第一个 UIViewController<时禁用弹跳效果/代码>.
I've been making a sample app with scrolling between UIViewControllers
but the point is i want to disable the bouncing effect at the end of scrolling and when going back to the first UIViewController
.
这是我的代码:
看看这里:
推荐答案
不知道你能不能.UIPageController 不是很可定制.
I don't know if you can. UIPageController is not very customizable.
就个人而言,当我想在 UIViewController 之间滚动时,我更喜欢使用一个简单的 UIViewController,它是一个容器,里面有一个 UIScrollView.然后我以编程方式在 UIScrollView 的 contentSize 中添加所有控制器.您必须将所有控制器添加为容器的子级.
Personally, when I want to scroll between UIViewController, I prefer using a simple UIViewController, which will be a container, with an UIScrollView in it. Then I add programmatically all the controllers in the contentSize of the UIScrollView. You have to add all the controllers as child of the container.
更新 iOS 9
以前的答案
像这样:
scrollView 是一个 IBOutlet,它对 ContainerViewController 的每个边缘都有约束
scrollView is an IBOutlet with contraints to each edge of the ContainerViewController
这篇关于禁用 UIPageViewController 弹跳 - Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!