在iOS中管理布局 [英] Managing Layouts in iOS

查看:72
本文介绍了在iOS中管理布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS开发的新手,我对JAVA Swing和Windows应用程序有扎实的背景. 我想学习如何在iOS中进行布局?我猜iOS没有像Java Swing中的布局管理器" . 开发UI的唯一方法是为每个控制器指定大小和位置?

I am new to iOS development, I have a solid background on JAVA Swing and Windows Applications. I want to learn how to do layouting in iOS? I guess iOS doesn't have "Layout Managers" like in Java Swing.. The only way to develop UI is specifying size and positions for every controller?

推荐答案

这也可能对您有帮助.

自动调整大小遮罩及其说明

1)UIViewAutoresizingNone
该视图不会自动调整大小. (这是默认值.)

1) UIViewAutoresizingNone
The view does not autoresize. (This is the default value.)

2)UIViewAutoresizingFlexibleHeight 当超级视图的高度发生变化时,视图的高度也会发生变化.如果不包含此常数,则视图的高度不会改变.

2) UIViewAutoresizingFlexibleHeight The view’s height changes when the superview’s height changes. If this constant is not included, the view’s height does not change.

3)UIViewAutoresizingFlexibleWidth
当超级视图的宽度发生变化时,视图的宽度也会发生变化.如果不包含此常数,则视图的宽度不会改变.

3) UIViewAutoresizingFlexibleWidth
The view’s width changes when the superview's width changes. If this constant is not included, the view’s width does not change.

4)UIViewAutoresizingFlexibleLeftMargin
视图的左边缘和超级视图的左边缘之间的距离会根据需要增大或缩小.如果不包含此常数,则视图的左边缘与超级视图的左边缘保持固定的距离.

4) UIViewAutoresizingFlexibleLeftMargin
The distance between the view’s left edge and the superview’s left edge grows or shrinks as needed. If this constant is not included, the view’s left edge remains a fixed distance from the left edge of the superview.

5)UIViewAutoresizingFlexibleRightMargin
视图右边缘和超级视图右边缘之间的距离会根据需要增加或缩小.如果不包含此常数,则视图的右边缘与超级视图的右边缘保持固定的距离.

5) UIViewAutoresizingFlexibleRightMargin
The distance between the view’s right edge and the superview’s right edge grows or shrinks as needed. If this constant is not included, the view’s right edge remains a fixed distance from the right edge of the superview.

6)UIViewAutoresizingFlexibleBottomMargin
视图的底部边缘和超级视图的底部边缘之间的距离会根据需要增加或缩小.如果不包含此常数,则视图的底边缘与超级视图的底边缘保持固定的距离.

6) UIViewAutoresizingFlexibleBottomMargin
The distance between the view’s bottom edge and the superview’s bottom edge grows or shrinks as needed. If this constant is not included, the view’s bottom edge remains a fixed distance from the bottom edge of the superview.

7)UIViewAutoresizingFlexibleTopMargin
视图的顶部边缘和超级视图的顶部边缘之间的距离会根据需要增加或缩小.如果不包含此常数,则视图的顶部边缘与超级视图的顶部边缘保持固定的距离.

7) UIViewAutoresizingFlexibleTopMargin
The distance between the view’s top edge and the superview’s top edge grows or shrinks as needed. If this constant is not included, the view’s top edge remains a fixed distance from the top edge of the superview.

有关更多信息,请阅读此文档.

For more information read this documentation.

这篇关于在iOS中管理布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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