android 风格

使用android平台的风格和主题

Android给用户提供了可供体验的主体效果,这些由底层操作系统带来的视觉体验会表现在app上。通过使用这些内置的风格和主题,你的app就会向用户展现最新版本的Android体验。

让你的activity看起来像一个对话框:

 
<activity android:theme="@android:style/Theme.Dialog">
 

让你的activity拥有一个透明的背景:

 
<activity android:theme="@android:style/Theme.Translucent">
 

申请你要定制的主题,会在/res/values/styles.xml中定义:

 
<activity android:theme="@style/CustomTheme">
 

申请一个应用到你的app中所有activities的主题,在<application>标签中添加android:theme属性:

 
<application android:theme="@style/CustomTheme">

猜你喜欢

转载自ddzhao.iteye.com/blog/1724549