【问题标题】:how set to the CENTER title in AlertDialog? [duplicate]如何在 AlertDialog 中设置为 CENTER 标题? [复制]
【发布时间】:2011-10-10 04:46:23
【问题描述】:

可能重复:
Custom dialog on Android: How can I center its title?

我有代码:

     return new AlertDialog.Builder(getActivity())

            .setTitle("Warning!")
            .setMessage("message!")
            .setPositiveButton("yes ",
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {

等等... .setTitle("Warning!") 如何设置为 CENTER?

【问题讨论】:

标签: java android android-alertdialog


【解决方案1】:

您不能在默认警报对话框中将标题居中。

您需要创建一个自定义对话框以使标题居中。

here 的答案描述了如何做到这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-10
    • 1970-01-01
    • 2016-12-21
    • 1970-01-01
    • 2016-01-22
    • 2016-03-16
    • 2019-07-11
    • 2013-03-31
    相关资源
    最近更新 更多