Vertical line using XML drawable

前端 未结 15 701
无人及你
无人及你 2020-11-27 09:57

I\'m trying to figure out how to define a vertical line (1dp thick) to be used as a drawable.

To make a horizontal one, it\'s pretty straightforward:



        
15条回答
  •  醉梦人生
    2020-11-27 10:21

    Depends, where you want to have the vertical line, but if you want a vertical border for example, you can have the parent view have a background a custom drawable. And you can then define the drawable like this:

    
    
        
            
                
                
    
            
        
    
        
            
                
            
        
    
    
    

    This example will create a 1dp thin black line on the right side of the view, that will have this drawable as an background.

提交回复
热议问题