Create styling string from resources

Create styling string from resources - Hello Friend GENERAL INFO FOR ANDROID DEVELOPMENT, In the article you read this time with the title Create styling string from resources, We have prepared this article for you to read and retrieve information there in. Hopefully the contents of postings Artikel TextView, We write this you can understand. Alright, good read.

The Title : Create styling string from resources
link : Create styling string from resources

Read also


Create styling string from resources

This example show how to create partial styling string from resources:


Edit values/strings.xml to add string resources with styling:
<resources>
<string name="app_name">AndroidStylingStringResources</string>
<string name="normal_name">It is Normal String</string>
<string name="italic_name">Partial <i>Italic String</i> from resources</string>
<string name="bold_name">Partial <b>Bold String</b> from resources</string>
<string name="underline_name">Partial <u>Underline String</u> from resources</string>
</resources>


Edit layout/activity_main.xml to use the string resources:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical"
tools:context="com.blogspot.android_er.androidstylingstringresources.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_gravity="center_horizontal"
android:autoLink="web"
android:text="http://android-er.blogspot.com/"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="@string/normal_name"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:textStyle="italic"
android:text="Whole TextView in italic style"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="@string/italic_name"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="@string/bold_name"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="@string/underline_name"/>

</LinearLayout>





Thus Article Create styling string from resources

The End Article Create styling string from resources This time, hopefully can give benefits to all of you. well, see you in posting other articles.

You are now reading the article Create styling string from resources with the link address http://xorislogo.blogspot.com/2016/07/create-styling-string-from-resources.html

0 Response to "Create styling string from resources"

Post a Comment