一、UIImageView

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 缩放显示,填满,比例不变

最新文章

  1. ASP.NET MVC为字段设置多语言显示 [转]
  2. redis的安装和启动
  3. i18n国际化
  4. Linux Shell 网络层监控脚本(监控包括:连接数、句柄数及根据监控反馈结果分析)
  5. swoole 教程
  6. post提交表单
  7. 使用 Git 和 Visual Studio Online 进行版本控制
  8. Codeforces Round #372 (Div. 2) A
  9. 沈逸老师PHP魔鬼特训笔记(6)--巫术与骨架
  10. 【测试环境】cywin的简单介绍
  11. jstl c标签 ”test does not support runtime expressions“
  12. cut命令及参数企业案列讲解及awk对比
  13. spoj Ae2b
  14. Java案例-用户注册邮箱绑定激活功能实现
  15. iptables 最终 第四章
  16. C++进阶--RAII 资源获取即初始化
  17. Docker 部署学习
  18. Python能做什么?
  19. ABP框架入门踩坑-配置User Secrets
  20. A Tool To Plot Mathematical Function

热门文章

  1. 配置sql server 允许远程连接
  2. ANE-调用原生地图注意点
  3. ASP.NET Core根据环境切换NLog配置
  4. python文件备份与简单操作
  5. 【OCP题库-12c】最新CUUG OCP 071考试题库(69题)
  6. “全栈2019”Java异常第三章:try代码块作用域详解
  7. 洛谷P1742 最小圆覆盖(计算几何)
  8. hadoop版本总结
  9. php性能优化二(PHP配置php.ini)
  10. [CentOS] 7 不执行文件 /etc/rc.d/rc.local