In order to make the text of TextView bold, we can make use of the XML attribute textStyle with a value as bold,
Example:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="My Text"
android:textAlignment="center"
android:textStyle="bold"
android:id="@+id/myTextView"/>
</LinearLayout>
You may also achieve this programmatically by using the method setTypeface,
TextView textView = findViewById(R.id.myTextView);
Typeface bold = Typeface.defaultFromStyle(Typeface.BOLD);
textView.setTypeface(bold);
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!