Custom ttf fonts are not showing properly in TextView on Android 4.4 KitKat

后端 未结 5 1127
忘掉有多难
忘掉有多难 2020-12-19 04:06

I have some text which has some bolded parts. Until KitKat this strategy (as mentioned in this post) worked perfectly well

My strings resources file:



        
5条回答
  •  误落风尘
    2020-12-19 04:31

    Put your custom font in android assets under folder name "font" or whatever you want

    Try this

    myTypeface = Typeface.createFromAsset(this.getAssets(),
                "fonts/<>.ttf");
    

    in onCreate() then

    [use youcontroll].setTypeface(myTypeface);
    

    Best of Luck...

提交回复
热议问题