My self.view has the wrong dimensions

假装没事ソ 提交于 2019-12-05 03:13:25

You should never use frame to tell your own dimension. frame is relative to the parent container view. To find the dimension with respect to your view's own coordinate system, use bounds: self.view.bounds

For example, the parent view may see the child view having width = 768 and height = 1024, but with a rotate 90 degree transform. This is how the parent view sees the child view, and this is what self.view.frame is about. The child view having a width = 1024 and height = 768 is reflected by how a view sees itself in its own coordinate system, which is self.view.bounds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!