ImageView displaying in layout but not on actual device

前端 未结 9 1792
悲&欢浪女
悲&欢浪女 2020-12-13 12:50

I have an ImageView that I want to display matching the full width of the device, I realized that like this:



        
9条回答
  •  有刺的猬
    2020-12-13 13:18

    I had a problem with a samsung phone not displaying my drawable but it worked fine on another phone. The picture was not in any large dimensions or otherwise abnormal.

    To solve this I simply put my picture asset into a drawable subfolder instead of having it in the main drawable folder. E.g from res/drawable to res/drawable-mdpi worked for me. If you have a picture to use for everything not having a specific dpi, put it into res/drawable-nodpi. Here's a bit more about the dpi folders.

提交回复
热议问题