Android LinearLayout Gradient Background

前端 未结 10 1793
渐次进展
渐次进展 2020-12-02 04:20

I am having trouble applying a gradient background to a LinearLayout.

This should be relatively simple from what I have read but it just doesn\'t seem to work. For r

10条回答
  •  再見小時候
    2020-12-02 04:49

    I don't know if this will help anybody, but my problem was I was trying to set the gradient to the "src" property of an ImageView like so:

    
    

    Not 100% sure why that didn't work, but now I changed it and put the drawable in the "background" property of the ImageView's parent, which is a RelativeLayout in my case, like so: (this worked successfully)

    
    

提交回复
热议问题