样式和主题
android自带主题位置\sdk\platforms\android-21\data\res\values
开发一个Activity时,进入Activity会出现闪白的问题,这个问题可以将背景指定为透明来解决.设置Activity背景为透明style方法:
在Manifest中将需要透明的Activity内设置theme为Theme.Translucent等主题.
或者仿Android自带的主题,在/res/values/styles.xml中重写一个style.
<style name="translucent"> <!-- <item name="android:windowBackground">@color/transparent</item> --> <!-- <item name="android:windowNoTitle">true</item> --> <item name="android:windowIsTranslucent">true</item> <!-- <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item> --> </style>
还可以指定parent继承一个已存在的style
<style name="translucent" parent="@android:style/Theme.Translucent"> </style>
在AndroidManifest.xml中指定主题时,可以在application或activity节点下添加属性
系统自带格式 android:theme="@android:style/Theme.Translucent"
自定义格式 android:theme="@style/translucent"
代码养活自己