开发者

Trouble with using layout-large with 160dpi large screen emulator (Android)

开发者 https://www.devze.com 2023-01-26 00:50 出处:网络
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 a

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号