【问题标题】:Android Dialog title color and title button?Android Dialog标题颜色和标题按钮?
【发布时间】:2012-04-25 01:13:15
【问题描述】:

我有一个按钮,单击它会打开一个对话框,其中包含我的 SQLite 数据库中的信息。我已经想出了如何更改背景颜色和文本颜色,但我无法设置标题文本颜色。另外我想知道是否有可能将按钮放在对话框标题的一个角落?我想把关闭按钮放在那里。

这是设置对话框的 onClickHelp 按钮的代码

public void onClickHelp(View v) {
    final Dialog duDialog = new Dialog(this);
    duDialog.setContentView(R.layout.data_usage);
    duDialog.getWindow().setBackgroundDrawableResource(R.color.title_text);

    duDialog.setTitle("Data Usage"); // I would like to set the color and add button here
    ListView data = (ListView) duDialog.findViewById(R.id.DataUsage);
    duCursor = Data.getAll(db);
    startManagingCursor(duCursor);
    duAdapter = new DataAdapter(duCursor);
    data.setAdapter(duAdapter);
    duDialog.show();

}

【问题讨论】:

    标签: android xml dialog styles


    【解决方案1】:

    您必须使用您的相关设计来​​设计您自己的自定义警报对话框。

    参考这个链接

    LINK 对话框文档

    LINK 自定义警报对话框示例

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-01
      • 1970-01-01
      相关资源
      最近更新 更多