Scaling an image to max available width, keeping aspect ratio and avoiding ImageView extra space

后端 未结 6 2098
后悔当初
后悔当初 2021-02-04 03:07

I have this simple layout XML, and a green_square.png file which is 30X30 pixels




        
6条回答
  •  渐次进展
    2021-02-04 03:45

    In my view, this ImageView extra layout is a bug. I had the same thing happen. As a result, text that I wanted to follow the green_square followed the extra layout. So what I did was specify the text relative to the bottom of the screen. That way, the text would go over the extra layout. I admit, it wasn't the best solution, but it looks much better than having a huge space between the green_square and the text.

提交回复
热议问题