绘图 - 8
来源:互联网 发布:jquery获得表单数据 编辑:程序博客网 时间:2024/05/16 05:29
autoresizesSubviews 和 autoresizingMask :
@property(nonatomic) BOOL autoresizesSubviews; // default is YES. if set, subviews are adjusted according to their autoresizingMask if self.bounds changes@property(nonatomic) UIViewAutoresizing autoresizingMask; // simple resize. default is UIViewAutoresizingNone
都是UI布局非常常见的两个属性和方法。
我们来看看具体:
这两个方法的大体意思就是子类会随着视图父类bounds的变动而自动调整。
而autoresingMask是一个枚举值:
typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 << 0, UIViewAutoresizingFlexibleWidth = 1 << 1, UIViewAutoresizingFlexibleRightMargin = 1 << 2, UIViewAutoresizingFlexibleTopMargin = 1 << 3, UIViewAutoresizingFlexibleHeight = 1 << 4, UIViewAutoresizingFlexibleBottomMargin = 1 << 5};
大体的解释:
在实际使用中也非常容易:
containerView.autoresizesSubviews = YES; containerView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
参考:
http://www.cnblogs.com/GarveyCalvin/p/4165151.html
这里提一下。如果用纯粹的autolayout,会发现效果比这个好多了!!
0 0
- 绘图 - 8
- 8-MATLAB绘图
- 5.3.8 绘图模式
- 5.3.8 绘图模式
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- Leetcode200: Super Ugly Number
- Codeforces Beta Round #1 A. Theatre Square
- Activiti进阶(四)——流程变量的设置和获取
- copy
- 抽象基类和纯虚函数
- 绘图 - 8
- Bmob之个人资料设置(一)
- 17、osgText::Text
- BZOJ 1001 (UVa1376, LA3661 ) - 平面图最大流(对偶图 -> 最短路)
- struts2-OGNL和类型转换(structs 自动数据表单获取)
- android propertyAnimator--()
- UITableView高度自适应
- python的生成器
- 1017. A除以B