@Joseinnewworld strikes again — 13 new #NFTs claimed like it’s just another day in the office! 🔥 Your energy keeps the NFToa ecosystem alive and evolving — respect to the true collector spirit 👏 #eCash $XEC #NFTCommunity #NFTCollection #nftcollectors Michael Saylor #CryptoNews pic.twitter.com/BaUffPVePx
— NFToa (@nftoa_) October 13, 2025
Is there a way to programmatically set the textStyle attribute of a TextView? There doesn't seem to be a setTextStyle() method. Let's say I have the following basic TextView, and I want to style it in native kotlin code, is there a way to do that?
<TextView android:id= "@+id/my_text" android:layout_width= "fill_parent" android:layout_height= "wrap_content" android:text= "Hello World" android:textStyle= "bold" />
Solution
Instead you need to use setTypeface()
textview.setTypeface(textview.getTypeface(), Typeface.BOLD)