I have a LayoutView in a ScrollView and want to set a my glass background PNG image that should be scaled automatically to wrap content.
In these layout view, there is a text view and the contents of this text area is variable.
Usually without any PNG background the size of layout view is not extended if isn’t necessary to view all the text set, but when I set PNG background the layout view automatically enlarged to the size of the PNG if I set wrap content on layout view.
How to set a custom background image scalable to fit the size of layout view that doesn’t influence the wrap content behavior?
As per your requirement i would suggest you- take your background image of Height= approx 50 pixel width= any
– convert this image into nine patch follow this link- http://developer.android.com/reference/android/graphics/NinePatch.html
by using nine patch images your background will be re sized/adjust as per the dynamic data.
Hope it helps.
Thanks