ios碎片小记
2016-01-06 17:26
323 查看
一、UIImageView
1.图片形状设为圆形时可能会由于图片的宽高比例导致显示出来的效果不是圆形
解决:设置UIImageView的contentMode为UIViewContentModeScaleAspectFill
ContentMode属性
UIViewContentModeScaleToFill 缩放以填充
UIViewContentModeScaleAspectFit 缩放以显示全部,比例不变
UIViewContentModeScaleAspectFill 缩放显示,填满,比例不变
1.图片形状设为圆形时可能会由于图片的宽高比例导致显示出来的效果不是圆形
解决:设置UIImageView的contentMode为UIViewContentModeScaleAspectFill
ContentMode属性
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, };
UIViewContentModeScaleToFill 缩放以填充
UIViewContentModeScaleAspectFit 缩放以显示全部,比例不变
UIViewContentModeScaleAspectFill 缩放显示,填满,比例不变
相关文章推荐
- iOS后台播放背景音乐
- iOS中const与static区别和联系
- IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)
- 安装centreon+nagios时,rrd出图出现乱码
- [转]IOS上路_01-Win7+VMWare9+MacOSX10.8+XCode4.6.3
- iOS中的md5,crc32校验
- iOS性能优化——重用的艺术
- iOS的Bundle资源束制作
- iOS企业级用户版本更新
- IOS中.a库的封装和使用以及遇到i386的问题
- iOS7 Background Remote Notification(后台远程通知——静默push)
- IOS 内存管理需要注意的地方
- iOS画虚线
- iOS 为项目添加多语言
- iOS语言国际化
- 180,改变IOS系统的方法
- iOS 9自动布局教程第一章--起步
- 第三方控件Masonry和IOS代码实现Autolayout的比较
- iOS开发的Pch预编译文件之Xcode7
- iOS - 颜色选择器