Nativescript: How do i create Such button?

Created on 13 Aug 2016  路  2Comments  路  Source: NativeScript/NativeScript

How do I create such button @
login-ticket

Please notice:

  • icons are left aligned while text is centered
  • text is in different font.

cc: @bradmartin

question

Most helpful comment

Hello @vekexasia,

You can achieve this with CSS using background-image for your icon.
For example something like this:


Button {
    width: 400;
    background-color: blue;
    color:white;
    font-family: sans-serif;
    font-size: 18;
    horizontal-align: center;
    text-align:center;

    background-image: url("res://icon");
    background-position: left;
    background-repeat: no-repeat;
    background-size: contain;
}

Which will result this in Android
button

All 2 comments

Hello @vekexasia,

You can achieve this with CSS using background-image for your icon.
For example something like this:


Button {
    width: 400;
    background-color: blue;
    color:white;
    font-family: sans-serif;
    font-size: 18;
    horizontal-align: center;
    text-align:center;

    background-image: url("res://icon");
    background-position: left;
    background-repeat: no-repeat;
    background-size: contain;
}

Which will result this in Android
button

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valentinstoychev picture valentinstoychev  路  3Comments

fmmsilva picture fmmsilva  路  3Comments

OscarLopezArnaiz picture OscarLopezArnaiz  路  3Comments

tsonevn picture tsonevn  路  3Comments

yclau picture yclau  路  3Comments