【发布时间】:2010-12-30 19:12:12
【问题描述】:
我想定制一个Dialog。因为我不喜欢它的风格,我想要圆角矩形而不是尖角。我知道AndroidManifest.xml中的主题如何实现,例如我用:
android:theme="@style/Theme.CustomDialog"
还有Theme.CustomDialog.xml:
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/filled_box</item>
<item name="android:windowNoTitle">true</item>
filled_box.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffffff"/>
<stroke android:width="3dp" color="#ffff8080"/>
<corners android:radius="30dp" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</shape>
如何通过扩展Dialog 或AlertDialog 来实现类似的结果?
【问题讨论】:
标签: android customization android-dialog android-theme