iOS Dev (29) UIViewContentMode
-
UIViewContentMode 都有哪些值:
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,
};
默认值是 0,也就是:
UIViewContentModeScaleToFill
一个个来理解下吧:
- UIViewContentModeScaleToFill:表示完全填充在 frame 里。
- UIViewContentModeScaleAspectFit:保持比例,都在 frame 内。
- UIViewContentModeScaleAspectFill:保持比例,填满但 frame 外也有。
- UIViewContentModeRedraw:啥意思我还不懂。
其他的是相似的,好理解:
- UIViewContentModeCenter:这个 image 的中心与 frame 的中心重合。
- UIViewContentModeTop:这个 image 的上边缘与 frame 的上边缘重合。
- UIViewContentModeBottom:这个 image 的下边缘与 frame 的下边缘重合。
- UIViewContentModeLeft:这个 image 的左边缘与 frame 的左边缘重合。
- UIViewContentModeRight:这个 image 的右边缘与 frame 的右边缘重合。
- UIViewContentModeTopLeft:类似。
- UIViewContentModeTopRight:类似。
- UIViewContentModeBottomLeft:类似。
- UIViewContentModeBottomRight:类似。
-
转载请注明来自:http://blog.csdn.net/prevention
分享到:
相关推荐
iOS Soft Dev Pack
ios-dev-flow-master.
iOSDev2021Spring
iOS游戏应用源代码——SlavaBushtruk-Alterplay-iOS-dev-tips.zip
iOS_Dev iOS개발(개발하는정대리참고) Swift My_First_iOS 헬로우 尼斯应用cocoapods를이용하여이션 NavigationViewController_tutorial 로그인입입stack(堆栈视图이용)
Beginning-iOS6-Dev_sourcecode 书本代码,比 ios5_dev多出几个章节
IOS应用源码——SlavaBushtruk-Alterplay-iOS-dev-tips-b6ab5ea.rar
《app-dev-curriculum-cn》 iOS playground文件 IOS 学习实战 swift
Beginning iOS 3D Unreal Games Dev 电子书PDF+源码完整版
location驱动ios12.4 ios12.3 ios12.2 ios12.1 ios12.0 ios11.0 ios11.4
开发iOS :sparkling_heart: 这是 iOS应用程序的存储库。地位: 发布了第一个版本,更多信息: : 设计精神随着时间的推移,我们将包括更多的本机代码,但是目前,我们正在采用本机Shell / Web视图的方法。 这种方法早...
项目名我们设定为:iotApp 1、在ios目录下新建bundle目录。后面编译打包离线资源,也会生成bundle目录,提前建,是为了防止某些情况下报错。... --dev false //设置为false时会对JavaScript代码进行优化处理
ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧版抓包工具ios旧...
iOS实例开发源码——dev2dev-HelloPopover-78e31c7.zip
IOS 11 Programming Fundamentals with Swift 4 amazon.com 上有售,值得分享!!
iOS Soft Dev Pack用于iPhone设备解锁越狱,安装后连接你的iPhone手机,使用前需要对你的资料进行备份,另外你的电脑还需要安装JRE软件。操作本软件需要相关知识,建议在教程指导下操作使用。
iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16...
BBCNewsApp-3SC-课程 在 3SC BU iOS Dev 课程中创建的应用程序的存储库,内置于 Obj C
29. Using Xcode 8 Storyboards to Build Dynamic TableViews 30. Implementing iOS 10 TableView Navigation using Storyboards in Xcode 8 31. Working with the iOS 10 Stack View Class 32. An iOS 10 Stack ...