问题
My app seems to be working on different sized screens well, apart from the tablet sized screens.
The way I have worked, is using a relative layout, which has lots of images. The images then have different sizes put in the folders, which will be picked up depending on which images the phone use ( depending on size )
The folders I use are:
drawable-hdpi
drawable-mdpi
drawable-ldpi
^ These were already added when I created the project in eclipse.
I read, and added drawable-xhdpi with the expectation that the larger screens would use this. I then put the images in, and my layout looked tiny on the android 3.0 emulator. So, I then put a mark on one of the images in xhdpi, and found that the tablet emulator isn't actually using this images.
Any ideas why? Does something need to go in the manifest?
回答1:
This can sometimes happen with 'compatability mode'
http://developer.android.com/guide/practices/screen-compat-mode.html
You can declare that you support these extra large screens like this:
<supports-screens android:xlargeScreens="true" />
or try declaring that you target SDK version 13, this will turn compatibility mode off. however this has other side-effects
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="13" />
It's all documented in the above link
回答2:
xhdpi
is "extra high DPI" (e.g. the Galaxy Nexus, small screen, big resolution), most tablets do not fit in this category. You're probably looking for drawable-xlarge
.
来源:https://stackoverflow.com/questions/9434884/android-extra-large-images-placed-in-res-drawable-xhdpi-arent-showing-on-tabl