Using Android build-in theme

We can apply Android build-in theme on our app. It's a example using Theme.Dialog.

Using Android build-in theme of Theme.Dialog

Modify AndroidManifest.xml using android:theme="@android:style/Theme.Dialog".
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AndroidStyle"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog" >
<activity
android:name=".AndroidStyleActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>


Modify main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="using Android's Theme.Dialog" />

</LinearLayout>



Related:
- Apply style on whole application/activity as theme

Next:
- Create custom Theme inheriting properties from build-in Theme



0 Response to "Using Android build-in theme"

Posting Komentar