Border in shape xml

前端 未结 3 1399
逝去的感伤
逝去的感伤 2020-12-12 13:12

I am trying to make a drawable to use for a button. I would like it to have this coloring, with a 2px border around it.

Everything works just fine except I cannot ge

3条回答
  •  轮回少年
    2020-12-12 14:08

    If you want make a border in a shape xml. You need to use:

    For the external border,you need to use:

    
    

    For the internal background,you need to use:

    
    

    If you want to set corners,you need to use:

    
    

    If you want a padding betwen border and the internal elements,you need to use:

    
    

    Here is a shape xml example using the above items. It works for me

     
       
       
      
      
    
    

提交回复
热议问题