当前位置:操作系统 > 安卓/Android >>

实现半透明Activity

/****************************************************************
  实现半透明Activity,覆盖在上一个activity上面,下面的那个activity依然可见
-------------------------------------------------------------------------------------------------------
<activity android:theme="@style/Theme.Translucent">

在values文件夹下建立一个sytles.xml文件
<style name="Theme.Translucent" parent="android:style/Theme.Translucent">
    <item name="android:windowBackground">@drawable/translucent_background</item>
   <item name="android:windowNoTitle">true</item>
   <item name="android:colorForeground">#fff</item>
</style>
/****************************************************************

 

/****************************************************************
  实现半透明Activity,覆盖在上一个activity上面,下面的那个activity模糊显示
-------------------------------------------------------------------------------------------------------
<activity android:theme="@style/Theme.Transparent">

在values文件夹下建立一个sytles.xml文件
<style name="Theme.Transparent">
   <item name="android:windowIsTranslucent">true</item>
   <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
   <item name="android:windowBackground">@drawable/transparent_background</item>
   <item name="android:windowNoTitle">true</item>
   <item name="android:colorForeground">#fff</item>
</style>
/****************************************************************

实现半透明Activity,背景为系统桌面壁纸。
<activity android:name="@style/Theme.Wallpaper"/>

<style name="Theme.Wallpaper" parent="android:style/Theme.Wallpaper">
   <item name="android:colorForeground">#fff</item>
</style>

作者“macd2666”
 

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,