Different layout for landscape

Asked

Viewed 106 times

0

good afternoon. I don’t know how to make a different layout, specific to landscape...but I wanted to do it in storyboard not in code, someone knows? Thanks.

3 answers

1

Good morning.. :)
To change the measurements of the storyboard I usually do the following:
first - I select the Storyboard.
2nd - I go on the RIGHT side and select the icone Show the size inspector.
- In the property SIMULATED SIZE switched to Freeform and I change the dimensions of
Storyboard.. I let it even look like LANDSCAPE...

I hope I understood your doubt correctly...
Anything you can say
Hugs :)

  • Thanks friend! I’ll try right now and I’ll tell you!

1

Good morning..
Another way I realized now is what I show in the image below
inserir a descrição da imagem aqui

In the circled part below (bottom left corner) to place the viewcontroller in landscape mode.
And to illustrate the first answer I gave, I circled the upper right corner to demonstrate where the property you previously spoke of is located.
Anything you can say.
Hugs :)

  • So I guess I didn’t make it very clear what I want.... in fact let the view controller in landscape mode I know I just don’t know how to make a layout other than portrait mode.For example let’s assume that I have two small views in portrait mode but in landscape mode I wanted these views to be a little more stretched by example... want to make a totally different layout in landscape understood? Thank you.

  • I got it now! I went on add new constraints and added 4 constants and then went on Vary for traits and fixed these changes for portrait and then did the same thing for landscape.But thanks for the help , thanks!

  • That’s right. After you made the first comment I understood :)... If you had spoken earlier I would have told you to make these steps.. : ) Anything is just talk.. I’m new to it (Swift) but I’m really enjoying it :) Hugs

  • Hi Ricardo! Blz? So I solved the problem of making a layout for each orientation : one for portrait and another for landscape , so far so good but now appeared other problem rs.... I’m not able to put this change to all devices understood .... for example when selecting iPhone 4s in storyboard and I go in Vary for traits ai the change does not serve for iPads , for example , do not appear the iPads in the list of devices when I click Vary for traits and then in width understood.Any help thanks! Thanks.

0

Good morning Danilo...
Man I hadn’t even noticed the iPad...
In fact if you notice the first two images I posted I normally not working with AUTOLAYOUT enabled...
When I enabled Autolayout I saw that the iPad option appeared.
I tried to make a simple screen.. and using the constraints make her look good on various devices including iPad. I also tried to use the VARY FIR TRAITS as you mentioned... Man, it got a shitty belly only.
So I deleted the view and started again from scratch.
Autolayaute enabled, Use Trait Variations enabled I put a VC with dimensions of iphoneSE.
I put the objects. I packed them the way I wanted.
I used in the palette SHOW THE SIZE INSPECTOR the AUTORESINZIG property of each object to "ANCHOR THEM" the way you wanted.
inserir a descrição da imagem aqui

Then to arrange all you surround in various formats..
Everything turned out cool... both in Paissagem and in Portrait. Below I put a print
ipone SE - portrait and landscape
ipone 5 - portrait and landscape
ipone 7 - portrait and landscape
Ipad pro 12.9 inch - portrait and landscape

inserir a descrição da imagem aqui


Was that the difficulty??? I understood the question correctly??? :)
If that’s what you want I can send you Storyboard.
Anything you can say.
Hugs.

  • It’s Ricardo! then ...it’s almost that but now it’s only missing even I make the changes to iPad . In the case you put there are two objects one yellow and the other blue right? What I’m not able to do is change for example in portrait leave the yellow object on top and the blue below but in landscape change that leave the blue on top and the yellow below.This I can do for the devices that are mobile phones iPhone 4s , SE , 7 and 7 plus , but for iPad I can’t because I’m using Vary for traits to use this but in the case of iPad do not.!

  • I saw here similar issues to mine and I’m thinking that it is not possible to make different layouts for iPad at least in storyboard. I will do in the code part will be the way.But case with you there tells me heim rs.... worth Ricardo !!

  • Good morning Danilo.. I understood what you want to do. But I got a curiosity. In the images above I put 3 OBJECTS. Above the YELLOW object has a GREEN BUTTON.. Following the example you gave.. When it was IPAD PAISSAGEM YELLOW DESCENDS AND BLUE RISES.. Where the boot WOULD??.. Hugs..

  • Good morning Ricardo! the green button could stay in the center for example.... I’m picking here for this tool saw never saw rs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.