在使用情节提要的 xcode 5 中,如何在启用自动布局的情况下制作一个完全可操作的垂直滚动滚动视图?
考虑到子视图有层次结构:
In xcode 5 using storyboards how would one make a fully operational vertical scrolling scrollview, with AutoLayout ON?
Considering the subviews have hierarchy:
1.UIView
2.UIScrollView
3.UIView (lets call this UIDetailView to make things easier)
请从代码到约束具体到任何视图是否必须更小等.
Please be specific from code to constraints to wether any of the views HAS to be smaller etc.
这篇博文详细介绍了如何使用 UIScrollView 和 Autolayout ON,使用纯自动布局方法.请注意,博客文章中的所有约束都是通过情节提要定义的.
This blog post details how to use a UIScrollView with Autolayout ON, using a pure autolayout approach. Note though that all constraints in the blog post are defined through the Storyboard.
帖子中的方法假定以下层次结构:
The approach in the post assumes the following hierarchy:
1. View (main view of my UIViewController)
2. Scroll View (UIScrollView)
3. Container View (UIView)
4. Content View (e.g. UIImageView)
我猜容器视图将是您的 UIDetailView,而内容视图将是您的 UIDetailView 中的任何 UIView.
I guess the Container View will be your UIDetailView, and the Content View will be any UIView inside your UIDetailView.
https://happyteamlabs.com/blog/ios-how-to-use-uiscrollview-with-auto-layout-pure-auto-layout/
这篇关于如何在 Xcode5 中使用 AutoLayout 制作 ScrollView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Xcode 4 的 Interface Builder 中滚动 UIScrollViewScrolling through UIScrollView in Interface Builder for Xcode 4(在 Xcode 4 的 Interface Builder 中滚动 UIScrollView)
滑动删除嵌入在 UIScrollView 中的 UITableViewswipe to delete in a UITableView which is embeded in a UIScrollView(滑动删除嵌入在 UIScrollView 中的 UITableView)
检查 UIScrollView 中的滚动方向Check direction of scroll in UIScrollView(检查 UIScrollView 中的滚动方向)
UIScrollView 不滚动?UIScrollView Not Scrolling?(UIScrollView 不滚动?)
UIScrollView 如何从其子视图中窃取触摸?How does UIScrollView steal touches from its subviews?(UIScrollView 如何从其子视图中窃取触摸?)
使用自动布局将子视图的宽度与其父视图匹配Matching subview#39;s width to it#39;s superview using autolayout(使用自动布局将子视图的宽度与其父视图匹配)