how to add bottom border in relativelayout

前端 未结 4 1805
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 06:04


        
4条回答
  •  鱼传尺愫
    2021-02-04 06:16

    For some reason the other solutions didn't work for me - all borders were shown no matter how I changed it. This worked:

    
    
        
            
                
                
            
        
    
        
            
                
                
    
            
        
    
    

    The color of the border is gray and the background is white for the container (LinearLayout in my example). You can simply change the second item to make the border thicker or have border on the top/left/right.

    This is how the layout xml looks like:

    
    
            
    
     
    

    I got the idea from here: Is there an easy way to add a border to the top and bottom of an Android View?

提交回复
热议问题