Defining Drawable Shape with in JAVA code

后端 未结 1 1516
忘掉有多难
忘掉有多难 2020-12-20 03:06

Hi Can I define this shape without using xml code


<         


        
相关标签:
1条回答
  • 2020-12-20 03:56

    Yes

    • use a ShapeDrawable to draw your rectangle with the padding you require
    • using a Paint with the appropriate color and stroke width
    • using a Linear gradient and adding this to the Paint as a shader
    0 讨论(0)
提交回复
热议问题