سؤال

I have different layout for different devices say 7 inch tablet and 10 inch tablet as shown in the picture of my project but I am unable to see my designed layout in the devices when I actually run it on the device it follows the default layout only.

Here you can see the layout folders for all the devices and I have designed each and every intent for all the activities in the below mentioned folder.

Can anyone suggest that how to get my designed layout perfect on the device.

هل كانت مفيدة؟

المحلول

This question is repeated

Have a look at this answer, it might help

What you can do is, in the layout. Make different format screen. Your layout does get filled alot. But that is one way around it.

EDIT

Here there is the official description of how support all the screen size. And as described the layout folders are:

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 folder are the same, but in the new Android API there isn't no more the layout-normal folder, but only layout folder. Also you have to know if there isn't the specific layout of the screen size in witch the app is running, by default the app takes the "default" layout.

EDIT
You can have different screen resolutions in the same folder, as you can learn from this images:

enter image description here

If you want a more specific layout for specific resolution you have to detect at run time the exact screen size.

نصائح أخرى

for 7 inch res/layout-large for 10 inch res/layout-xlarge

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top