change theme ? or just background

原创
2013/12/11 19:02
阅读数 80

You need to apply one of available themes to your application. You can do it AndroidManifest.xml, just use android:theme attribute:

android:theme="@android :style/Theme.Holo" if you want dark theme orandroid:theme="@android :style/Theme.Holo.Light" if you want light theme.

If you use put this app in one of your <activity> tags, only corresponding activity will be styled, if you put it in <application> tag, style will be applied to the whole application.

Of course, you can define your own style in styles.xml:

<style name="AppTheme" parent="android:Theme.Light"> <item name="android:windowBackground">@drawable/bg_window</item> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style>

Here's the example of AndroidManifest.xml:

<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".Activity1" android:theme="@style/AppTheme2" /> <activity android:name=".Activity2" />

In this example, AppTheme2 will be applied only to Activity1, while AppTheme will be applied to all other activities.

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部