捉襟见肘之UIView中contentMode属性
UIView.h
- @property(nonatomic) UIViewContentMode contentMode; // default is UIViewContentModeScaleToFill
- typedef NS_ENUM(NSInteger, UIViewContentMode) {
- UIViewContentModeScaleToFill,
- UIViewContentModeScaleAspectFit, // contents scaled to fit with fixed aspect. remainder is transparent
- UIViewContentModeScaleAspectFill, // contents scaled to fill with fixed aspect. some portion of content may be clipped.
- UIViewContentModeRedraw, // redraw on bounds change (calls -setNeedsDisplay)
- UIViewContentModeCenter, // contents remain same size. positioned adjusted.
- UIViewContentModeTop,
- UIViewContentModeBottom,
- UIViewContentModeLeft,
- UIViewContentModeRight,
- UIViewContentModeTopLeft,
- UIViewContentModeTopRight,
- UIViewContentModeBottomLeft,
- UIViewContentModeBottomRight,
- };
找资料的时候,找到这张图片,简单粗暴,直接拿来领悟一下就可以了。
特别提到:
aspect ratio (高宽比)
clipped to fill(裁剪填充)
在整理一下她们的定义:
- UIViewContentModeScaleAspectFit:
- The option to scale the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.
- 这个选项用来缩放当前视图大小来保持当前视图的宽高比例不变,当前视图的其他的区域是透明的
捉襟见肘之UIView中contentMode属性的更多相关文章
- UIView 中 frame, bounds, center 属性的关系
最近一直在学 iOS 开发,所以专门创建了这样一个类别,将自己学习中的一些问题整理,记录下来.由于自己是初学者,所以所写的文章非常基础,写这个类别一是为了给自己留下存 档,二是为了给和我有同样问题的初 ...
- [BS-24] UIImageView的contentMode属性
UIImageView的contentMode属性 所有的UIView都有个contentMode属性,UIImageView继承自UIView,我们在使用UIImageView时,经常要考虑这些 ...
- UIView的常见属性
UIView的常见属性: @interface UIView : UIResponder<NSCoding, UIAppearance, UIAppearanceContainer, UIDyn ...
- XCODE UITextField 中的属性和用法
XCODE UITextField 中的属性和用法 一些基本的用法 UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedR ...
- 格而知之2:UIView的autoresizingMask属性探究
UIView的autoresizingMask属性,是用在当一个UIView实例的父控件的尺寸发生变化时,来自动调整UIView实例在父控件中的位置与尺寸的.autoresizingMask属性是一个 ...
- QF——UI之UIImageView及UIView的形变属性transform
UIImageView: 专门用来放置图片的视图.它里面放置的图片是[UIImage imageNamed: (NSString) imgName]生成的,注意千万别只写成图片NSString类型的名 ...
- iOS开发之UIView的常见属性
1.所有控件都继承自UIView,UIView的常见属性如下: @property(nonatomic,readonly) UIView *superview;获得自己的父控件对象 @property ...
- [iOS] UIView的clipsTobounds属性
如题,有两个view: view1,view2view2添加view1到中,如果view2大于view1,或者view2的坐标不全在view1的范围内,view2是盖着view1的,意思就是超出的部份 ...
- iOS基础--UIView的常见属性
UIView的常见属性以及方法 @property(nonatomic,readonly) UIView *superview; // 获得自己的父控件对象 @property(nonatomic,r ...
随机推荐
- Windows Server+AMD GPU+HDMI时_黑边_不铺满问题的解决办法
HDMI接显示器或电视,有黑边或者被放大了是个很常见的问题,显卡设置界面里改下Scale或者Overscan/Underscan就行,可问题是WindowsServer版的CCC没有控制颜色对比度和缩 ...
- 关于浏览器URL中出现会话验证字符说明
服务器安装了网站安全狗,访问网站的时候会显示一串类似iissafedogccsision=7Z86v5H5z这样的会话验证信息. 安全狗官方解释 出现该字符的主要原因是用户开启了网站安全狗的CC防护的 ...
- php 升级php5.5
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm yum install php55w php55w-opcache yum install ...
- Vware Workstation pro 12|虚拟机
Vmware是比较不错的PC虚拟化软件,vmware11+不在支持32的系统安装!体积比之前小了很多 VMware 12 官方中文页面 http://vmware.com/cn/products/wo ...
- android 点亮屏幕与锁定屏幕
PowerManager pm=(PowerManager) getSystemService(Context.POWER_SERVICE); //获取电源管理器对象 PowerManager.Wak ...
- openldap+phpadmin的搭建安装
1.概念介绍 LDAP是轻量目录访问协议,英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP.它是基于X.500标准的,但是简单多了并且可以根据 ...
- Edge detection using LoG
intensity梯度值分布跟图片的大小有关, 比如将一张小图片放大后会变得很模糊, 原先清晰的edge, 即大的梯度值变得模糊. 但是原有的边缘通常还是肉眼可分辨的. 但用Sobel 算子可能就检测 ...
- Maven插件maven-surefire-plugin
插件官方文档:maven-surefire-plugin 1.surefire plugin的作用surefire 插件用来在maven构建生命周期的test phase执行一个应用的单元测试. 它会 ...
- 100114B
bfs #include<iostream> #include<queue> #include<cstring> #include<cstdio> us ...
- CocoaPods安装与使用
CocoaPods简介: CocoaPods 是什么? CocoaPods 是开发 OS X 和 iOS 应用程序的一个第三方库的依赖管理工具.利用 CocoaPods,可以定义自己的依赖关系 (称作 ...