Creating A Digital Clock Widget With A Custom Font

前端 未结 3 2013
野趣味
野趣味 2021-01-01 23:49

I\'m trying to create a digital clock widget with a custom font. And this has proven to be the biggest challenge of my Android experience. (Thought it would be as simple as

3条回答
  •  粉色の甜心
    2021-01-02 00:44

    For API 17 or higher to customize fonts, you need to download .ttf file for any fonts you want then create a directory assets/fonts/ then save your fonts

    Typeface fonttype
    fonttype = Typeface.createFromAsset(getActivity().getAssets(), "fonts/robotoregular.ttf");
    textclock.setTypeface(fonttype);
    

提交回复
热议问题