autoresizingMask

20121220看了autoresizing

autoresizingMask

An integer bit mask that determines how the receiver resizes itself when its superview’s bounds change.

@property(nonatomic)  UIViewAutoresizing autoresizingMask
Discussion

When a view’s bounds change, that view automatically resizes its subviews according to each subview’s autoresizing mask. You specify the value of this mask by combining the constants described in UIViewAutoresizing using the C bitwise OR operator. Combining these constants lets you specify which dimensions of the view should grow or shrink relative to the superview. The default value of this property isUIViewAutoresizingNone, which indicates that the view should not be resized at all.

When more than one option along the same axis is set, the default behavior is to distribute the size difference proportionally among the flexible portions. The larger the flexible portion, relative to the other flexible portions, the more it is likely to grow. For example, suppose this property includes the UIViewAutoresizingFlexibleWidth and UIViewAutoresizingFlexibleRightMargin constants but does not include theUIViewAutoresizingFlexibleLeftMargin constant, thus indicating that the width of the view’s left margin is fixed but that the view’s width and right margin may change. Thus, the view appears anchored to the left side of its superview while both the view width and the gap to the right of the view increase.

If the autoresizing behaviors do not offer the precise layout that you need for your views, you can use a custom container view and override itslayoutSubviews method to position your subviews more precisely.



UIViewAutoresizingNone

The view does not resize.

Available in iOS 2.0 and later.

Declared in UIView.h.

UIViewAutoresizingFlexibleLeftMargin

The view resizes by expanding or shrinking in the direction of the left margin.

Available in iOS 2.0 and later.

Declared in UIView.h.

UIViewAutoresizingFlexibleWidth

The view resizes by expanding or shrinking its width.

Available in iOS 2.0 and later.

Declared in UIView.h.

UIViewAutoresizingFlexibleRightMargin

The view resizes by expanding or shrinking in the direction of the right margin.

Available in iOS 2.0 and later.

Declared in UIView.h.

UIViewAutoresizingFlexibleTopMargin

The view resizes by expanding or shrinking in the direction of the top margin.

Available in iOS 2.0 and later.

Declared in UIView.h.

UIViewAutoresizingFlexibleHeight

The view resizes by expanding or shrinking its height.

Available in iOS 2.0 and later.

Declared in UIView.h.

UIViewAutoresizingFlexibleBottomMargin

The view resizes by expanding or shrinking in the direction of the bottom margin.

Available in iOS 2.0 and later.

Declared in UIView.h.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值