I'm having trouble getting a 160dpi, 480x800 emulator to display the contents of my main.xml in a layout-large folder. It seems to still be using the main.xml in my regular layout folder. Are there any common reasons it wouldn't be reading this file correctly?
To put it into context, I have a .png called "back_large" in my drawable-mdpi folder. I also have a .png called "back." Both are 160dpi, but "back_large" is roughly twice the size of "back." In the main.xml within the layout-large folder, I have an ImageView that points to "back_large". In the main.xml within the regular layout folder, I have an ImageView that points to "back." When I run both the Normal- and 开发者_JS百科Large-sized 160dpi emulators, they both pick up "back," which leads me to believe layout-large is not being implemented properly. I just don't know why.
Thanks.
as far as I know layout-large resource qualifires are just used for the layout only and not for drawable images. put two images (back.png) with the same name in hdpi and mdpi folders. In you xml layouts both in layout normal/large folders just give reference to back.png. Android system will automatically detect the desired resources after checking the screen density and size for the target device during execution of application on device. .. Hope this helps.
精彩评论