ios碎片小记
2024-10-16 12:05:33
一、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 缩放显示,填满,比例不变
最新文章
- ASP.NET MVC为字段设置多语言显示 [转]
- redis的安装和启动
- i18n国际化
- Linux Shell 网络层监控脚本(监控包括:连接数、句柄数及根据监控反馈结果分析)
- swoole 教程
- post提交表单
- 使用 Git 和 Visual Studio Online 进行版本控制
- Codeforces Round #372 (Div. 2) A
- 沈逸老师PHP魔鬼特训笔记(6)--巫术与骨架
- 【测试环境】cywin的简单介绍
- jstl c标签 ”test does not support runtime expressions“
- cut命令及参数企业案列讲解及awk对比
- spoj Ae2b
- Java案例-用户注册邮箱绑定激活功能实现
- iptables 最终 第四章
- C++进阶--RAII 资源获取即初始化
- Docker 部署学习
- Python能做什么?
- ABP框架入门踩坑-配置User Secrets
- A Tool To Plot Mathematical Function
热门文章
- 配置sql server 允许远程连接
- ANE-调用原生地图注意点
- ASP.NET Core根据环境切换NLog配置
- python文件备份与简单操作
- 【OCP题库-12c】最新CUUG OCP 071考试题库(69题)
- “全栈2019”Java异常第三章:try代码块作用域详解
- 洛谷P1742 最小圆覆盖(计算几何)
- hadoop版本总结
- php性能优化二(PHP配置php.ini)
- [CentOS] 7 不执行文件 /etc/rc.d/rc.local