I'm trying to make a LinearLayout that has height = LayoutParams.WRAP_CONTENT.
I am receiving an arbitrarily sized bitmap from a server to set as the background image for the LinearLayout.
How do I set the background image of the LinearLayout without resizing the view if the received bitmap is larger than the contents of the linear layout?
It would be nice if the background image could maintain its aspect ratio, and scale to match t开发者_运维百科he width of the screen.
I tried overriding onMeasure as a temporary solution, but that just wound up biting me.
how about using an imageView inside your layout , which also has its adjustViewBounds set to true in order to keep aspect ratio?
精彩评论