How can I create a border around an Android LinearLayout?

前端 未结 9 1090
长发绾君心
长发绾君心 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:27

    This solution will only add the border, the body of the LinearLayout will be transparent.

    First, Create this border drawable in the drawable folder, border.xml

    
    
        
        
    
    

    Then, in your LinearLayout View, add the border.xml as the background like this

    
    

提交回复
热议问题