NSLayoutAttributeLeft与NSLayoutAttributeLeading的区别
来源:互联网 发布:淘宝的发货地址在哪 编辑:程序博客网 时间:2024/05/16 13:06
前言
在使用Masonry
时,有mas_left
与mas_leading
,同样有mas_right
与mas_trailing
,在中国都习惯左、右布局,使用left/right
与heading/trailing
是一样的。但是,在其它部分国家,开发者们的习惯不都是左、右或者前、后布局,还有右、左或者后、前布局的,因此是不一样的。
在中国,就放心的使用左、右或者前、后的方式吧。
Masonry属性
1
2
3
4
5
6
7
8
@property(nonatomic,strong,readonly)MASViewAttribute*mas_left;
@property(nonatomic,strong,readonly)MASViewAttribute*mas_top;
@property(nonatomic,strong,readonly)MASViewAttribute*mas_right;
@property(nonatomic,strong,readonly)MASViewAttribute*mas_bottom;
@property(nonatomic,strong,readonly)MASViewAttribute*mas_leading;
@property(nonatomic,strong,readonly)MASViewAttribute*mas_trailing;
我们看到这几个属性,但是我们并不需要都使用,因为在中国人的行为习惯中,大家都习惯从左到右的方式布局。我们完全可以不使用mas_leading
和mas_trailing
对于苹果原生约束的枚举NSLayoutAttribute
中的几个:
1
2
3
4
5
6
7
8
NSLayoutAttributeLeft=1,
NSLayoutAttributeRight,
NSLayoutAttributeTop,
NSLayoutAttributeBottom,
NSLayoutAttributeLeading,
NSLayoutAttributeTrailing,
我们更常见的是使用leading
和trailing
而不是left/right
。
推荐
笔者所见过使用Masonry
的写法中,几乎没有见过使用mas_leading/mas_trailing
的,几乎都是使用mas_left/mas_right
,当然也包括笔者。
因此,笔者也推荐大家使用Masonry
时,使用mas_left/mas_right
,但是使用xib/storyboard
上的约束时,使用heading/trailing
最多。
0 1
- NSLayoutAttributeLeft与NSLayoutAttributeLeading的区别
- iOS NSLayoutAttributeLeft与NSLayoutAttributeLeading的区别
- ios autolayout中NSLayoutAttributeLeft(Right)与NSLayoutAttributeLeading(Trailing)区别
- iOS Autolayout中NSLayoutAttributeLeft(Right)与NSLayoutAttributeLeading(Trailing)区别
- ios autolayout中NSLayoutAttributeLeft(Right)与NSLayoutAttributeLeading(Trailing)区别
- &&与&,||与| 的区别
- &与&& ,|与||的区别
- -> 与 .的区别,&与*
- &与&& ,|与||的区别
- 注释区别???/与//的区别
- 与的区别与作用
- 与的区别与作用
- 与的区别与作用
- “//”与“\\”还有“/”与“\" 的区别
- java &与&& |与||的区别
- java &与&& |与||的区别
- 与的区别
- 与的区别
- 华为--嵌入式软件工程师面试题汇总
- php 生成条形码(基于yii)
- Xen虚拟化技术的模式和演变
- JavaWeb防止表单重复提交
- Java反射机制和TelephoneManager电话监听
- NSLayoutAttributeLeft与NSLayoutAttributeLeading的区别
- 剑指offer—左旋转字符串
- Ajax实现页码式分页
- ffmpeg超详细综合教程二——为直播流添加滤镜
- [从头学数学] 第215节 带着计算机去高考(七)
- 点评CAT搭建 分布式监控系统
- Java main方法参数args[]
- 制作更生动的演示文档
- ElasticSearch索引构建速度调优