相关疑难解决方法(0)

Android - 使用自定义字体

我将自定义字体应用于a TextView,但似乎没有更改字体.

这是我的代码:

    Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/myFont.ttf");
    TextView myTextView = (TextView)findViewById(R.id.myTextView);
    myTextView.setTypeface(myTypeface);
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我解决这个问题吗?

android custom-font android-fonts android-typeface

262
推荐指数
8
解决办法
24万
查看次数