Scale background image to wrap content of layout

前端 未结 9 1896
执笔经年
执笔经年 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:10

    Work with RealtiveLayout (no mandatory but instead of FrameLayout and use android:scaleType="fitXY". Move the imageView to RealtiveLayout which contains the textviews android:id="@+id/HeaderList" and unset the background android:background="@drawable/header" at this level.

     
    
    
           
    
    
             
             
    
                 
                 
              
          
    

    More or less it should work!

提交回复
热议问题