Bearded-Hen / Android-Bootstrap

Bootstrap style widgets for Android, with Glyph Icons
MIT License
7.29k stars 1.43k forks source link

How to add icon and text in same button #180

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi,

I have updated the plugin and now i cant design a button with FA icon and text, i have this code:

    <com.beardedhen.androidbootstrap.BootstrapButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:layout_gravity="right"
        android:onClick="aplicarSettings"
        bootstrap:bootstrapText="Save"
        bootstrap:bootstrapBrand="success"
        bootstrap:roundedCorners="true"
        bootstrap:fontAwesomeIcon="fa_save"/>

Only show the text, and if i delete the line bootstrap:bootstrapText="Save" only show the icon with the line android:text="Save"

Thanks

jamie-beardedhen commented 7 years ago

You can achieve this using the bootstrapText attribute:

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:bootstrapBrand="success"
    app:bootstrapText="Share on {fa_facebook} with a {fa_thumbs_o_up}"
    />```
ghost commented 7 years ago

Thanks! Regards.