Android - Extra large images placed in res/drawable-xhdpi aren't showing on tablet emulator, why?

99封情书 提交于 2019-12-13 16:17:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!