开发者

Xcode says that a UIView is in Landscape mode when it is Portrait

Xcode says that a UIView is in Landscape mode when it is Portrait

why does Xcode says that the selected UIView is in Landscape mode if in fact it is on Portrait mode? at first I thought that the reason of this was because the main view was in Landscape mode but that is not true because when I select my horiz开发者_JS百科ontal (landscape) UIView I get the same problem take a look:

Xcode says that a UIView is in Landscape mode when it is Portrait


Xcode only says its landscape or portrait as a "Simulated Metric" hence the title of the group in the inspector.

Which means it does not reflect what you see in the run time.

To solve this problem simply change the width and height of the UIView e.g. in landscape make it 1004 X 768 and in portrait do the same 1024 X 748.

Why that happened? As you mentioned the reason for this is that your main view was in landscape and when adding new UIViews Xcode just assumes they are portrait, so the size is portrait and mode is landscape.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜