Posts

Showing posts with the label Text Syle

Text Style of a Substring - Android Studio - Kotlin

Image
We will change the style of some sub-strings of text of TextView using the ''SpannableString'' class ✓BOLD ✓ITALIC ✓BOLD_ITALIC ✓STRIKE-THROUGH ✓UNDERLINE VIDEO Step 1:  Create a new Project  or  open new project Step 2: Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" tools:context= ".MainActivity" > <TextView android:id= "@+id/text_view" android:textSize= "18sp" android:textColor= "#000" android:layout_width= "wrap_content" android:layout_height= "...

Text Style of a Substring - Android Studio - Java

Image
We will change the style of some sub-strings of text of TextView using the ''SpannableString'' class ✓BOLD ✓ITALIC ✓BOLD_ITALIC  ✓STRIKE-THROUGH  ✓UNDERLINE VIDEO Step 1:  Create a new project   OR   Open your project Step 2: Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" tools:context= ".MainActivity" > <TextView android:id= "@+id/textView" android:textSize= "18sp" android:textColor= "#000" android:layout_width= "wrap_content" android:layout_...