Scale background image to wrap content of layout

前端 未结 9 1898
执笔经年
执笔经年 2020-12-23 17:45

I have a layout that contains some text fields and has a background image that\'s displayed at the top of my activity. I\'d like the background image to scale to wrap the c

9条回答
  •  鱼传尺愫
    2020-12-23 18:26

    You may try this trick,

    • FrameLayout (wrapcontent, wrapcontent)
      • ImageView (match parent, match parent) // its your background
      • LinearLayout (wrapcontent, wrapcontent)
        • All your contents goes inside this linear layout or any other type what ever you want

提交回复
热议问题