picker icon indicating copy to clipboard operation
picker copied to clipboard

Fontfamily doesn't apply

Open 1mehdifaraji opened this issue 3 years ago • 3 comments

Font family doesn't apply on labels text

1mehdifaraji avatar Nov 14 '21 16:11 1mehdifaraji

i have the same issue

HAFDIAHMED avatar Jan 14 '22 11:01 HAFDIAHMED

i solve it by adding this code on the android\app\src\main\res\values.\styles.xml `

<!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
                
                <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
                <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
        </style>

        <style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="android:textAlignment">gravity</item>
            <item name="android:gravity">start</item>
            <item name="android:fontFamily">@font/arab_font</item>

        </style>
        <style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="android:textAlignment">gravity</item>
            <item name="android:gravity">start</item>
            <item name="android:textColor">#000000</item>

        


        </style> 
`

BUUUUUT for the fonts names u need the create the font folder on this path android\app\src\main\res\font and the font file name should not starts with capital letter all the name should inclues just small letters ANNNNNND you have to reload the metro sever to se the changes ( relead the project from the begining )

HAFDIAHMED avatar Jan 20 '22 16:01 HAFDIAHMED

Thank you for this workaround @HAFDIAHMED. (Note you'll have to put the <item name="android:fontFamily">@font/arab_font</item> in the bottom style too to get it into the items.)

I can see why the developers might not recommend this out of the box, since it will style all of these universally, but it's a lot better than nothing.

abedolinger avatar Feb 23 '22 01:02 abedolinger