Activity全透明

實現Activity的透明效果還可以先上效果圖:
這裏寫圖片描述
1.先在res \ values \ Color.xml 下定義一個背景色 :

 <color name="transparent">#3F3F3F</color>

2.然後在res \ values \style下面:

<style name="Transparent">
        <item name="android:windowBackground">@color/transparent</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item>
    </style>

3.最後一步了在AndroidManifest.xml中對應的Activity配置下就好了:

 <activity
            android:name="com.zong.online.singer.online_singer_search"
            android:theme="@style/Transparent" />
    </application>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章