开发者

Images in a web view on a Motorola Droid. What size?

开发者 https://www.devze.com 2023-01-20 13:46 出处:网络
I am developing a Java Android application that displays web content from the assets folder in a web view. I had no problem getting this content to display in the application but I am confused as to w

I am developing a Java Android application that displays web content from the assets folder in a web view. I had no problem getting this content to display in the application but I am confused as to why my开发者_如何学编程 images are not displaying properly. I'm working with a Motorola Droid that is supposed to be 480x854 resolution. When I create banner images using these dimensions and attempt to display them in the web view they're enormous and they flow off of the screen. It doesn't appear that the web view is actually 480x854. Can somebody let me know what I am missing here? I do not know what size to set the images to so they are just right.


First of all, never create a layout with exact measurements like that. Use the fill_parent or wrap_content variables in order to get the sizes you want. If you do a 480x854 on one device it may fill the screen, on another it might fill the screen twice over. As to answer your question I'm not sure why it does this. Just stay away from using exact pixel variables like that and the problem will be avoided.

0

精彩评论

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