1 建立一个values/styles.xml,内容如下 2 <?xml version="1.0" encoding="utf-8"?> 3 <resources> 4 <style name="Theme.Transparent" parent="@android:style/Theme.Dialog"> 5 6 <item name="android:windowIsTranslucent">true</item> 7 <item name="android:windowBackground">@android:color/transparent</item> 8 <item name="android:windowContentOverlay">@null</item> 9 <item name="android:windowNoTitle">true</item> 10 <item name="android:windowIsFloating">true</item> 11 <item name="android:backgroundDimEnabled">true</item> 12 13 </style> 14 </resources> 15 16 在AndroidManifest.xml中的某个activity中 17 android:theme="@style/Theme.Transparent"
我自己的代码:
1 <style name="Theme.MyThrme" parent="@android:style/Theme.Holo.DialogWhenLarge"> 2 <!-- All customizations that are NOT specific to a particular API-level can go here. --> 3 <item name="android:windowNoTitle">true</item> 4 </style>