LA_*_*LA_ 4 android customdialog android-alertdialog
我已经创建了自己的(自定义)对话框.但是希望它的风格像原始的Alert Dialog.即黑色标题背景和底部的灰色按钮背景.有没有任何随时可用的xml?(所以,我不担心确切的颜色,高度,字体大小等)
这个答案是不正确的
使用 Theme.Dialog.Alert
来自themes.xml:
<!-- Default theme for alert dialog windows, which is used by the
{@link android.app.AlertDialog} class. This is basically a dialog
but sets the background to empty so it can do two-tone backgrounds. -->
<style name="Theme.Dialog.Alert" parent="@android:style/Theme.Dialog">
<item name="windowBackground">@android:color/transparent</item>
<item name="windowTitleStyle">@android:style/DialogWindowTitle</item>
<item name="windowIsFloating">true</item>
<item name="windowContentOverlay">@null</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这可以被一个XML布局或Android清单内应用,如这里引用的:
<activity android:theme="@android:style/Theme.Dialog.Alert">
Run Code Online (Sandbox Code Playgroud)
或使用的活动setTheme(int).但是,这似乎不是推荐的做法.此错误报告中显示的简单示例代码.
| 归档时间: |
|
| 查看次数: |
8036 次 |
| 最近记录: |