--------------------------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应用中配置自定义的主题样式,包括透明背景和半透明效果的实现方式。通过修改AndroidManifest.xml文件中的activity标签以及创建XML资源文件来定制应用的视觉表现。

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



