UIView的autoresizingMask属性研究
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高。
|
1
2
3
4
5
6
7
8
9
|
enum { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 << 0, UIViewAutoresizingFlexibleWidth = 1 << 1, UIViewAutoresizingFlexibleRightMargin = 1 << 2, UIViewAutoresizingFlexibleTopMargin = 1 << 3, UIViewAutoresizingFlexibleHeight = 1 << 4, UIViewAutoresizingFlexibleBottomMargin = 1 << 5}; |
UIViewAutoresizingNone:就是不自动调整,即不使用自动调整,不会随superView的大小改变而改变。
UIViewAutoresizingFlexibleLeftMargin: 自动调整自己的左边与superView左边的距离,以保证自己的右边与superView右边的距离不变。
UIViewAutoresizingFlexibleRightMargin:自动调整自己的右边与superView的右边距离,以保证自己的左边与superView左边的距离不变。
UIViewAutoresizingFlexibleTopMargin:自动调整自己的顶部与superView顶部的距离,以保证自己的底部与superView底部的距离不变。
UIViewAutoresizingFlexibleBottomMargin:自动调整自己的底部与superView底部的距离,以保证自己的顶部与superView顶部的距离不变。
UIViewAutoresizingFlexibleWidth:自动调整自己的宽度,以保证自己的左边、右边与superView左边、右边的距离不变。
UIViewAutoresizingFlexibleHeight:自动调整自己的高度,以保证自己的顶部、底部与superView顶部、底部的距离不变。
autoresizingMask的组合使用: 也就是枚举中的值可以使用 | 隔开同时多个使用,以同时拥有多个值所指示动功能,这样,可以针对不同的场景作不同的变化。
举例:
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin:自动调整subview的宽度,以保证subview的左边、右边与其superView的左边、右边的距离不变,并自动调整subview的底部与superView底部的距离,以保证subview的顶部与其superView顶部的距离不变。
其他的组合类似
UIView的autoresizingMask属性研究的更多相关文章
- 格而知之2:UIView的autoresizingMask属性探究
UIView的autoresizingMask属性,是用在当一个UIView实例的父控件的尺寸发生变化时,来自动调整UIView实例在父控件中的位置与尺寸的.autoresizingMask属性是一个 ...
- 关于UIView 的autoresizingMask属性,即UIViewAutoresizing
enum { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 &l ...
- UIView 的 autoresizingMask 属性 详解。
转载自:liubo0_0的专栏 链接网址:http://blog.csdn.net/liubo0_0/article/details/7085935 在 UIView 中有一个autoresizin ...
- UIView 的autoresizingMask属性
autoresizingMask属性的意思就是自动调整子控件与父控件中间的位置,宽高,定义如下: typedef NS_OPTIONS(NSUInteger, UIViewAutoresizing) ...
- 关于UIView的AutoresizingMask属性的研究
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. 1 2 3 4 5 6 7 8 9 enum ...
- 关于UIView的autoresizingMask属性的研究【转】
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. 1 2 3 4 5 6 7 8 9 enum ...
- ios开发之--关于UIView的autoresizingMask属性的研究
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. enum { UIViewAutoresizi ...
- 转-关于UIView的autoresizingMask属性的研究
在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. 1 2 3 4 5 6 7 8 9 enum ...
- UIView的autoresizingMask属性
今天做相册列表的时候,发现有些 UITableViewController 属性不好记忆,然后就查找了一些资料.做一下备份. 在 UIView 中有一个autoresizingMask的属性,它对应的 ...
随机推荐
- 【cookie接口】- jmeter - (请求提示no cookie)
1.虽然 请求成功 响应码 200 ,但是 返回code 1 ,表示接口不成功 2.加入 空的cookie 管理器就可以了 返回 code 0 注意:状态码 200 只是表示请求是成功的 , ...
- python 文件编译成exe可执行文件。
pyinstaller打包方法: pyinstaller安装参考地址:http://www.pyinstaller.org/ pywin32的下载地址:https://sourceforge.net/ ...
- 【shell 练习3】用户管理脚本(一)
一.创建十个用户,密码为八位 [root@localhost ~]# cat UserManger02.sh #!/bin/bash . /etc/init.d/functions [ $UID -n ...
- C++字符串拼接和输入
一 .char类型字符串以空字符结尾 1.以空字符结尾,空字符被写作\0,其ASCII码为0,用来标记字符串的结尾. char dog[4]={'a','b','c','d'} //不是一个字符串 ...
- Mysql-表和字段操作
1.查看表 show tables; 2.创建表 create table test( id int primary key auto_increment, name varchar(40) not ...
- oracle数据库中常见的操作语句(一)
一 创建表空间 create tablespace lfdc_data logging datafile 'D:\Database\lfdc_data.dbf' size 50m autoextend ...
- python学习笔记06:操作文件
调用内置的open函数打开文件,传递两个参数:文件路径(绝对路径或相对路径),打开模式('r':读,'r+':读写,'w':写,'b':二进制): f = open('data.txt','w') f ...
- tomcat8配置管理员后仍然报403
tomcat8配置管理员后仍然报403 修改conf/tomcat-users.xml <role rolename="manager"/> <role ro ...
- python dict 字典
字典是通过hash表的原理实现的,每个元素都是一个键值对,通过元素的键计算出一个唯一的哈希值,这个hash值决定了元素的地址,因此为了保证元素地址不一样,必须保证每个元素的键和对应的hash值是完全不 ...
- 2019 front end jobs collection
2019 front end jobs collection Alibaba https://ant.design/docs/spec/work-with-us-cn https://www.yuqu ...