Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

android - Layout folders for Google Nexus 7 and 10

I am developing an application for google nexus 7 and 10. But there is a problem. I don't know which layout folder should be used for 7 and 10.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For nexus 7

layout-large-hdpi

For nexus 10

layout-xlarge-xhdpi

Note: The app takes images from these folders only if you have not given higher precedence qualifiers. For example if you have given a layout folder like layout-sw360dp the app will take only the images from this folder even if you have given separate layouts like the one I said above. Because in android there is an order of precedence in which you have to give layouts.

Check this official doc for the order of precedence of qualifiers.

EDIT: Providing layouts for Tablets is a very confusing thing in Android. I had a horrible time in providing layouts for tablets. However I finally succeeded after so many attempts. Having said that one thing you have to remember is that, even if you have not given the right folder, Android will take the next suitable layout folder with respect to the device.

Now regarding your comment, for samsung 7, I think the ideal layout will be

layout-large-mdpi.

And for samsung 7.7, it may be

layout-large-hdpi (which I haven't tried yet)

And for Samsung 10.1, it will be

layout-xlarge-mdpi

Regarding your Nexus 10, you have to make separate images to fit to its size.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...