Defining Drawable Shape with in JAVA code

后端 未结 1 1523
忘掉有多难
忘掉有多难 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)
提交回复
热议问题