Android 將Activity轉化為DialogActivity
阿新 • • 發佈:2019-02-15
轉載地址:http://blog.csdn.net/lovexjyong/article/details/17021319
1.在style檔案中定義樣式:
<style name="DialogTransparent" parent="@Android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowIsTranslucent">true</item>
</style>
2.在你的Activity中引用theme
android:theme="@style/DialogTransparent"