--------------------------values/style
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="KaZaMainStyle" parent="@android:style/Theme.Light.NoTitleBar.Fullscreen">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>
---------------------------------Manifest.xml
<activity
android:name=".Suiping"
android:theme="@style/KaZaMainStyle" >
</activity>
-------------------------------.java
public class Suiping extends Activity {
@Override
protected void onCreate(
Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
}
--------------------------------------
---------------------------------------second
<?xml version="1.0" encoding="utf-8"?>
<drawable name="translucent_background">#77ffffff</drawable>
<style name="Theme.Translucent" parent="android:style/Theme.Translucent">
<item name="android:windowBackground">@drawable/translucent_background
</item>
</style>
</resources>
----------------manifest.xml
<activity
android:name=".Suiping"
android:theme="@style/Theme.Translucent" >
</activity>
---------------------------
本文详细介绍了如何在Android应用中自定义主题,并实现透明背景的效果,包括资源文件的修改、主题样式的创建以及Activity的配置。
1万+

被折叠的 条评论
为什么被折叠?



