以编程方式在Kotlin中自定义TypeFace

Rah*_*ana 2 android kotlin android-typeface

如何设置任何字体TextView.使用java我们做这样的事情

TextView tv = (TextView) findViewById(R.id.custom);
tv.setTypeface(null, Typeface.BOLD);
Run Code Online (Sandbox Code Playgroud)

在使用kotlin时如何执行此类操作.哪个是在kotlin中这样做的有效方法?kotlin有更好的方法吗?

holder.itemView.title.typeface = ?
Run Code Online (Sandbox Code Playgroud)

Rah*_*ana 6

谢谢经过大量的研究,我解决了它的单线

holder.itemView.title.typeface = Typeface.DEFAULT_BOLD
Run Code Online (Sandbox Code Playgroud)

希望它可以帮助别人!