ios – 如何在Xcode 7中使用对象库的Stack View

我最近安装了 Xcode 7 beta并找到了一些东西
像对象一样的新对象库

水平堆栈视图和垂直堆栈视图.

When i put some controls inside it,stackview seems to be resizable
according to the control size. When i present more controls the stack
seems to be adjust automatically as of the stack view.
Either
adjusting horizontally or vertically?

它是否来自其他一些移动平台

解决方法

使用UIStackView的一个主要优点是它使用自动布局来定位和调整其排列的UIViews.因此,您不必担心将UIViews放置在UIStackView中.对于水平堆栈,这意味着第一个排列视图的前缘固定到堆栈的前缘,最后排列的视图的后缘固定到堆栈的后缘.您可以尝试将两个或多个控件插入到水平堆栈视图中,它们如何相互水平对齐w.r.t.

The UIStackView class provides a streamlined interface for laying out
a collection of views in either a column or a row. Stack views let you
leverage the power of Auto Layout,creating user interfaces that can
dynamically adapt to the device’s orientation,screen size,and any
changes in the available space. The stack view manages the layout of
all the views in its arrangedSubviews property. These views are
arranged along the stack view’s axis,based on their order in the
arrangedSubviews array. The exact layout varies depending on the stack
view’s axis,distribution,alignment,spacing,and other properties.

如何使用

以下是raywenderlich网站的详细教程:

http://www.raywenderlich.com/114552/uistackview-tutorial-introducing-stack-views

如需了解更多信息,请查看https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/index.html

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...