*** 如果在程序中改变了某个控件的transform,那么请不要使用frame计算子控件的布局,应该使用bounds+center代替 ***
官方文档上关于transform属性的说明:
Changes to this property can be animated. However, if the transform property contains a non-identity transform, the value of the frame property is undefined and should not be modified. In that case, you can reposition the view using the center property and adjust the size using the bounds property instead.
iOS中frame和transform的坑
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 自定义了UIButton类,重写了该类的layoutSubviews方法,但是在layoutSubviews中计算...
- 1. iOS动画 总的来说,从涉及类的形式来看,iOS动画有:基于UIView的仿射形变动画,基于CAAnimat...
- 文章目录 iOS动画 UIView动画2.1 设置UIView动画的两种语法形式2.2 设置属性形变动画的两种类型...
- View Programming Guide for iOS 阅读笔记 (个人学习记录,从文档中摘抄出部分,谷歌翻...