问题描述
我遇到了一个与Xcode的故事板的一个奇怪的问题。
我有一个很好的视图控制器在我的董事会,视图的起点不是0.所有x起点都是160,起点是240.
所有视图看起来都像在左上角..
奇怪的是,大多数视图控制器的子视图似乎也有错误的坐标。
有人知道什么可能是
这里的东西是 X
不是左上角,而是中心。只需点击检查器(原点)中的左上角的点,你应该看到'正确'的值。
I have ran into a weird issue with Xcode-s storyboards.
I have a good amount of view controllers in my board, and for some reason all of their view's origins are not 0. All of x origins are 160 and y origins are 240.
All of the views look like they are still on top-left..
Weird thing also is that most of the view controller's subviews seem to have wrong coordinates as well.
Does anyone know what might be the issue here?
The thing here is that X
in your example is not top-left referenced but center. Just click the top left dot in the inspector (origin) and you should see the 'correct' values.
这篇关于故事板奇怪的控制器视图帧起源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!