![Using Android build-in theme of Theme.Dialog Using Android build-in theme of Theme.Dialog](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiB2YxmgwSq8Ov_fYaz22avrkEQkVxhhXe6lBnsGiOuthDZ0DuoFNwz7MG7QtLhD1Nk3AprnhzmX1dTYq3yjNHi2GrM4mvVg-ZWM3xbmm37fCltqjGcFZ1mgG5lkZAQfjDt8NmStyoJW3Oi/s400/AndroidTheme_04.png)
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
No comments:
Post a Comment