Android Gradient drawable programmatically

后端 未结 1 2018
说谎
说谎 2021-01-11 12:09

I have a gradient drawable defined in xml that I use it as a background, like this:




        
相关标签:
1条回答
  • 2021-01-11 12:53

    Found the answer!. Possible duplicate Multi-gradient shapes.

    Replaced:

    backColor.setBounds(0, 0,0, 4);
    shadow.setBounds(0,98, 0, 0);
    

    for

    layerList.setLayerInset(0, 0, 0, 0, 4);
    layerList.setLayerInset(1, 0, 98, 0, 0);     
    
    0 讨论(0)
提交回复
热议问题