Create alternate layout

Asked

Viewed 47 times

0

I have a project and I need to adjust to the various types of screens, I have tried with the ConstraintLayout more to what I want doesn’t work, I researched and found something about Alternative Layout. It would be different XML’s for each type of screen. How would it be? , someone can help.

  • Here is some interesting material for this question https://answall.com/questions/13201/design-responsivo-para-aplicativo-android

  • Did not take my doubt, had already seen this post. I would like to layoust alternative.

1 answer

0

There are Android devices of all shapes and sizes, therefore, the layout of your app needs to be flexible. That is, instead of define its layout with rigid dimensions that presuppose certain screen size and ratio, your layout needs to respond in a way efficient to different sizes and orientations.

In the documentation of Android itself, has an article about Compatibility with different screen sizes. The figure below shows how wide the text view with match_parent adjusts as the width of the screen is changed by the orientation of the device.

inserir a descrição da imagem aqui

Devices with Android Operating System not only come with various screen sizes (mobile phones, tablets, Tvs etc.) but the screens also have different pixel sizes. That is, while one device has 160 pixels per square inch, another fits 480 pixels in the same space. If you do not consider these variations in pixel density, the system may resize your images (resulting in blurred images) or the images may appear at a completely wrong size.

See more in the documentation where you talk about Compatibility with different pixel densities.

  • This post had already seen elsewhere, it speaks only of types of layouts, only that actually wanted to create alternative layouts.

Browser other questions tagged

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