Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom TypeFace in Kotlin Programmatically

How to set typeface of any TextView. Using java we do something like this

TextView tv = (TextView) findViewById(R.id.custom);
tv.setTypeface(null, Typeface.BOLD);

How such operation could be performed while using kotlin. Which will be the efficient way to do this in kotlin? Is there any better way provided with kotlin?

holder.itemView.title.typeface = ?
like image 852
Rahul Khurana Avatar asked Dec 05 '22 14:12

Rahul Khurana


1 Answers

Thanks after lot of research i solved it in single line

holder.itemView.title.typeface = Typeface.DEFAULT_BOLD

Hope it helps someone else !!

like image 63
Rahul Khurana Avatar answered Dec 11 '22 11:12

Rahul Khurana