How to make bottom border in drawable shape XML selector?

前端 未结 1 382
醉酒成梦
醉酒成梦 2021-01-11 18:42

I\'m trying to create a drawable shape with different states for my button. So I wrote this:



        
1条回答
  •  感情败类
    2021-01-11 19:14

    First I'm separating the shapes to make them easier to manage.

    This is your btn_negative_selector.xml

    
    
        
        
        
    
    

    create folder called 'xml' in your res and save these shapes into it:

    1) rectangle_button_pressed:

        
            
            
            
        
    

    2) rectangle_button_focused:

        
            
            
            
        
    

    3) This one rectangle_button.xml will have a border at the bottom of it by defining a shape using . first is bottom layer and last is the top layer.

    
    
        
            
                
                
            
        
        
            
                
                
            
    
        
    
    

    0 讨论(0)
提交回复
热议问题