在Eclipse环境下一步一步教您做透明的背景。
File->New->Other->Android XML File->Next
选择Value,输入文件名,点击“Finish”来创建配置文件。
创建colors.xml
1 2 3 4 | < ?xml version="1.0" encoding="utf-8"?> <resources> <color name="transparent">#0000</color><!-- 0000是全透明,您也可以9000 --> </resources> |
创建styles.xml
1 2 3 4 5 6 7 8 | < ?xml version="1.0" encoding="utf-8"?> <resources> <style name="translucent"> <item name="android:windowBackground">@color/transparent</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item> </style> </resources> |