How can I create a border around an Android LinearLayout?

前端 未结 9 1130
长发绾君心
长发绾君心 2020-12-22 20:33

I have one big layout, and one smaller layout inside of it.

How do I create a line border around the small layout?

9条回答
  •  一个人的身影
    2020-12-22 21:24

    I'll add Android docs link to other answers.

    https://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

    It describes all attributes of the Shape Drawable and stroke among them to set the border.

    Example:

    
      
      
    
    

    Red border with transparent background.

提交回复
热议问题