在res/values/中加入一個新的檔案
styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
在res/values/中加入一個新的檔案
color.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="transparent">#00000000</color> </resources>
最後在AndroidManifest中,Activity設定修改Theme 為 @style/Theme.Transparent
沒有留言:
張貼留言