如何在X code5与自动版式滚动型 [英] How to make a ScrollView with AutoLayout in Xcode5

查看:108
本文介绍了如何在X code5与自动版式滚动型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在X code 5用故事板怎么一会做一个全面运作的垂直滚动滚动视图,与自动版式ON?结果
考虑到子视图具有层次结构:

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)

请从code特定约束还判定是否任何的意见必须小于等。

Please be specific from code to constraints to wether any of the views HAS to be smaller etc.

推荐答案

本博客文章详细介绍了如何使用带有自动布局上的UIScrollView,使用纯自动布局方法。请注意,虽然在博客中,所有的约束都通过故事板定义。

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/

这篇关于如何在X code5与自动版式滚动型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆