The screen supports multiple devices using large, mock-normal, and mock-up layouts.

I created the layout , the layout is normal, and the layout is xlarge in the res folder, and I copied all the xml files to these layout folders

First, I want to ask, what is the difference between the layout ( default ) and the layout is a normal folder?

I know that if I run the application on a large screen, the application will accept XML files with layout-xlarge . Therefore, I created all the elements in layout-xlarge , because I want to use FrameLayout in tap2 10.1 , but when I run it in note2 or s3 mobile , it looks different because the size is not the same .

So, how can I make the application run in tap2 10.1 (1,280 x 800) and note2 or s3 mobile (1,280 x 720) ??

+6
source share
2 answers

There is an official description of how to support the entire screen size. And as described in the layout folders:

res/layout/my_layout.xml // layout for normal screen size ("default") res/layout-small/my_layout.xml // layout for small screen size res/layout-large/my_layout.xml // layout for large screen size res/layout-xlarge/my_layout.xml 

So, layout and layout-normal are in the same place, but in the new Android API there is no longer a folder with a layout, but only a layout folder. You should also know if there is a specific screen size layout in that the application is running, by default the application accepts the default layout.

EDIT

You may have different screen resolutions in the same folder that you can recognize from these images:

enter image description here

If you need a more specific layout for a specific resolution, you need to determine the exact screen size at runtime.

+12
source

From Multi-Screen Support , you should define a layout folder similar to this

 res/layout/my_layout.xml // layout for normal screen size ("default") res/layout-large/my_layout.xml // layout for large screen size res/layout-xlarge/my_layout.xml // layout for extra-large screen size res/layout-xlarge-land/my_layout.xml // layout for extra-large in landscape orientation 

(screen type database enabled)

 xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp 
0
source

Source: https://habr.com/ru/post/950480/


All Articles