Is there an easy way to add a border to the top and bottom of an Android View?

后端 未结 24 2864
盖世英雄少女心
盖世英雄少女心 2020-11-22 13:36

I have a TextView and I\'d like to add a black border along its top and bottom borders. I tried adding android:drawableTop and android:drawableBottom

24条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 14:17

    To change this:

    
    

    I prefer this approach in "drawable/top_bottom_border.xml":

    
    
        
            
                
            
        
        
            
                
            
        
    
    

    This only makes the borders, not a rectangle that will appear if your background has a color.

提交回复
热议问题