ios - buttons disappear on rotation -


i'm reworking existing project allow screen rotation , multiple devices whenever rotate screen in simulator, buttons disappear. started scratch toy example works not active project. things cause this? in storyboard auto layout.

as per question first must check whether application using size class or not , 1 other thing please check constraints breaking or not while changing orientation.

it issue not breaking of constraints follow below procedure. if can see per below image need change constraints only. enter image description here

secondly if not need use size class selecting main.storyboard or viewcontroller.xib.

then need go file inspector , select use size class below use auto layout.

for making application multiple device orientation size class comes in handy.

please have @ images below.

application without size class

result how ui displayed in device. enter image description here

enabling size class file inspector. enter image description here

once have made changes , viewcontroller able change constraints according device of different orientation.

wany-hany size class - device display view in in landscape or portrait. add required controls in size class. enter image description here

wcompact-hregular size class - for iphones in portrait mode only. if have added control in size class not displayed when application in landscape mode , not in ipad either. enter image description here

wany-hcompact size class - for iphones in landscape mode only. if have added control in size class not displayed when application in portrait mode , not in ipad either. enter image description here

final result when displayed in device or simulator. label displayed in portrait mode , invisible in landscape mode. enter image description here

conclusion. displaying label in landscape mode need add label in wany-hany size class , change constraints portrait , landscape modes. ipad can use wregular-hregular.

hope helps in solving problem.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -