UIView 的 autoresizingMask 属性 详解。
转载自:liubo0_0的专栏 链接网址:http://blog.csdn.net/liubo0_0/article/details/7085935
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高。
enum {
UIViewAutoresizingNone = 0,
UIViewAutoresizingFlexibleLeftMargin = 1 << 0,
UIViewAutoresizingFlexibleWidth = 1 << 1,
UIViewAutoresizingFlexibleRightMargin = 1 << 2,
UIViewAutoresizingFlexibleTopMargin = 1 << 3,
UIViewAutoresizingFlexibleHeight = 1 << 4,
UIViewAutoresizingFlexibleBottomMargin = 1 << 5
};
typedef NSUInteger UIViewAutoresizing;
分别解释以上意思。
UIViewAutoresizingNone就是不自动调整。
UIViewAutoresizingFlexibleLeftMargin就是自动调整与superView左边的距离,也就是说,与superView右边的距离不变。
UIViewAutoresizingFlexibleRightMargin就是自动调整与superView的右边距离,也就是说,与superView左边的距离不变。
UIViewAutoresizingFlexibleTopMargin
UIViewAutoresizingFlexibleBottomMargin
UIViewAutoresizingFlexibleWidth
UIViewAutoresizingFlexibleHeight
以上就不多解释了,参照上面的。
也可以多个枚举同时设置。如下:
subView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin |UIViewAutoresizingFlexibleRightMargin;
如果有多个,就用“|”关联。
还有一个属性就是autoresizesSubviews,此属性的意思就是,是否可以让其subviews自动进行调整,默认状态是YES,就是允许,如果设置成NO,那么subView的autoresizingMask属性失效。
UIView 的 autoresizingMask 属性 详解。的更多相关文章
- 自动布局之autoresizingMask使用详解(Storyboard&Code)
自动布局之autoresizingMask使用详解(Storyboard&Code) http://www.cocoachina.com/ios/20141216/10652.html 必须禁 ...
- android:exported 属性详解
属性详解 标签: android 2015-06-11 17:47 27940人阅读 评论(7) 收藏 举报 分类: Android(95) 项目点滴(25) 昨天在用360扫描应用漏洞时,扫描结果, ...
- OutputCache属性详解(一)一Duration、VaryByParam
目录 OutputCache概念学习 OutputCache属性详解(一) OutputCache属性详解(二) OutputCache属性详解(三) OutputCache属性详解(四)— SqlD ...
- OutputCache属性详解(二)一 Location
目录 OutputCache概念学习 OutputCache属性详解(一) OutputCache属性详解(二) OutputCache属性详解(三) OutputCache属性详解(四)— SqlD ...
- OutputCache属性详解(三)— VaryByHeader,VaryByCustom
目录 OutputCache概念学习 OutputCache属性详解(一) OutputCache属性详解(二) OutputCache属性详解(三) OutputCache属性详解(四)— SqlD ...
- OutputCache属性详解(四)— SqlDependency
目录 OutputCache概念学习 OutputCache属性详解(一) OutputCache属性详解(二) OutputCache属性详解(三) OutputCache属性详解(四)— SqlD ...
- WPF依赖属性详解
WPF依赖属性详解 WPF 依赖属性 英文译为 Dependency Properties,是WPF引入的一种新类型的属性,在WPF中有着极为广泛的应用,在WPF中对于WPF Dependency P ...
- HTML video 视频标签全属性详解
HTML 5 video 视频标签全属性详解 现在如果要在页面中使用video标签,需要考虑三种情况,支持Ogg Theora或者VP8(如果这玩意儿没出事的话)的(Opera.Mozilla.C ...
- Android组件---四大布局的属性详解
[声明] 欢迎转载,但请保留文章原始出处→_→ 文章来源:http://www.cnblogs.com/smyhvae/p/4372222.html Android常见布局有下面几种: LinearL ...
随机推荐
- Codeforces Round #473 (Div. 2)
A. Mahmoud and Ehab and the even-odd game time limit per test 1 second memory limit per test 256 meg ...
- Luogu【P1725】琪露诺(单调队列,DP)
本文是笔者第二篇解题报告.从现在开始,会将练的一些题发到博客上并归类到"解题报告"标签中. 琪露诺是这样一道题 这道题可以用纯DP做,但是据说会超时.(为什么?看起来过河这题比它数 ...
- P1266 速度限制 (最短路,图论)
题目链接 Solution 在最短路转移的时候在队列或者堆中记录状态为 \(f[u][v]\) 代表上一个节点为 \(u\) ,速度为 \(v\) . 然后按部就班转移即可... Code #incl ...
- python中的 __xxx__ 方法
1 __class__ instance.__class__ The class to which a class instance belongs def foo(): pass class A(o ...
- Charger Battery Warning Message 的 改善
今天與人聊到有關 charger battery safety 的 warning message, 認為說 warning message 真的有起到 保護 user 的作用? 譬如: batter ...
- Scrapy学习-13-使用DownloaderMiddleware设置IP代理池及IP变换
设置IP代理池及IP变换方案 方案一: 使用国内免费的IP代理 http://www.xicidaili.com # 创建一个tools文件夹,新建一个py文件,用于获取代理IP和PORT from ...
- PHP获取今天开始和结束的时间戳
$t = time();$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$ ...
- centos 7安装postgresql10.3
最新版本安装请移步:阿里云服务器 centos 7 安装postgresql 11 一.Postgresql简介 官方网站:https://www.postgresql.org/ 简介参考zhihu文 ...
- hdu 1250(大整数)
Hat's Fibonacci Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
- SqlHelper类-全面
// ===============================================================================// Microsoft Data ...