Search code examples
androidcssnativescript

Remove button borders - nativescript


I am trying to remove borders of register button

#register{
   background-color: transparent;
   border-color: transparent;
   border: 0;
   border-width: 0;
}

border property seems like is not support in nativescript styling docs and when I use border-radius: 1 border is despairing.

Platform: android (5.0.2) and {N} 1.7.1


Solution

  • I have tested a button with your styles and borders are removed with no problem. Can you specify on what platform and {N} version you are encountering this issue!? Styling background-color of Button will remove the default material design styles as described here and anti-aliasing borders were fixed with version 1.7.0 of {N} so border-radius: 1 should be working as espected.

    In CSS the following code

    border : 0 solid black
    

    is identical to the following in {N} and CSS as well

     border-width : 0 
     border-color: black;
    

    (by default border is of type solid)

    So you can apply button styles without using the shorthand (border: 0 solid black;)