Tono Nam
Tono Nam

Reputation: 36048

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

enter image description here

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 horizontal (landscape) UIView I get the same problem take a look: enter image description here

Upvotes: 0

Views: 411

Answers (1)

Amr Elsehemy
Amr Elsehemy

Reputation: 1033

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.

Upvotes: 1

Related Questions