Android Dialog标题颜色和标题按钮?

时间:2012-04-25 01:13:15

标签: android xml dialog styles

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

以下是我的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();

}

enter image description here

1 个答案:

答案 0 :(得分:2)

您必须使用相关设计设计自己的自定义提醒对话框。

参考此链接

对话

LINK文档 用于自定义警报对话框的

LINK示例

相关问题