Using ImageView as background for an Android Layout

前端 未结 2 2018
南笙
南笙 2021-02-09 03:20

I want to take advantage of the scaleType property, which I cannot use if I set my image using the background property on the LinearLayout. I\'ve tried using a

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-09 04:15

    I did it thusly using a RelativeLayout as the parent:

    
    
        
    
        
    
            
    
        
    
    
    

    My Style for it:

    
    

    I used a style, because the alpha setting doesn't work on lower APIs (can't remember what the limit is offhand).

提交回复
热议问题