What is the equivalent of “android:fontFamily=”sans-serif-light" in Java code?

后端 未结 6 1803
半阙折子戏
半阙折子戏 2020-12-23 15:46

My question is quite simple:

In every of my textview, I am currently using the attribute

android:fontFamily=\"sans-serif-light\"

6条回答
  •  佛祖请我去吃肉
    2020-12-23 16:22

    It would be possible by using

    setTypeface(Typeface tf, int style) method of TextView class.

    spinner_text.setTypeface(Typeface.SANS_SERIF,Typeface.NORMAL);

提交回复
热议问题