Land and Portrait

Asked

Viewed 44 times

0

What would the image code look like to keep the aspect ratios between views in both Landscape and Portrait? The image below is only prototype has no code yet.

inserir a descrição da imagem aqui

  • 2

    What do you mean, "Image code"? And what proportions would those be? Make an example of your question, put the prototype version in landscape mode, and use numbers if possible. If you make the code at least of the portrait version, it will help a lot.

  • I believe that using Constraintlayout will help you in your need, follows the link explaining how to use it. https://developer.android.com/training/constraint-layout/index.html

  • Image code: XML of the displayed layout. Distance proportions: margins between the components.

  • I don’t know if this will be a repetitive comment, but as Pablo Almeida hinted you can make a layout for the Landscape version and one for Portrait. Having already the layout file, right-click in the layout folder of res > New > Layout Resource file, in this window in "Available Qualifiers" select "Orientation and click the double arrow to the right, choose "Landscape"and create the file with the same name as you already had. Androidstudio will create a new XML file where you can make your layout in Landscape, and when recreating the layout by rotating the smartphone, the appropriate one will appear

  • Thank you all, I was able to solve the case. It was just a matter of alignment between one component and another.

No answers

Browser other questions tagged

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