swipe-button
swipe-button copied to clipboard
Add font to text
Is there a way to set font style to the text shown on the button??
Is there any way to set font style to the text shown on the button?? I really need it...please help me
I haven't found a way yet
Just add a style to your SwipeButton:
styles.xml:
<style name="AppTheme.SwipeButton">
<item name="android:fontFamily">@font/nunito_bold</item>
</style>
your layout:
<com.ebanx.swipebtn.SwipeButton
android:id="@+id/swipeBTN"
style="@style/SwipeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:button_background="@drawable/shape_button"
... />
I'm compiling with buildToolsVersion '27.0.3'
on Android Studio 3.1.2.
Hope it helps!
above method doesnt work. any clue? thanks in advance!
Above method wouldn't work as the textview is created dynamically and the style attribute is not linked to it. @Testator as of know there's no method to do it, but u can fork & create a custom attribute and then assign the font to the textview.
@Testator You can see the implementation here https://github.com/ebanx/swipe-button/pull/66