美文网首页iOS
iOS中frame和transform的坑

iOS中frame和transform的坑

作者: Summit_yp | 来源:发表于2021-10-15 09:35 被阅读0次

    *** 如果在程序中改变了某个控件的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.

    https://www.jianshu.com/p/9dfd337e8266

    相关文章

      网友评论

        本文标题:iOS中frame和transform的坑

        本文链接:https://www.haomeiwen.com/subject/bkapoltx.html