【问题标题】:how can I change dialog box's title color?如何更改对话框的标题颜色?
【发布时间】:2012-08-03 08:34:03
【问题描述】:

我在我的应用程序中使用对话框。但我想改变我的对话框标题的颜色。我该如何处理。谢谢...

【问题讨论】:

  • 我无法处理它,我改变了我的应用程序感谢大家的关注和建议:D

标签: android colors styles dialog


【解决方案1】:

您可以尝试扩展默认主题并在您的活动中使用它。您需要扩展 Theme.Dialog 样式。查找示例here

【讨论】:

    【解决方案2】:

    如果您使用AlertDialog,则可以使用setCustomTitle(View) 函数(也在生成器中)。

    【讨论】:

      【解决方案3】:

      你可以根据自己的意愿创建一个xml..然后在对话框中膨胀布局..

          LayoutInflater factory2 = LayoutInflater.from(this);
          final View coloredChangedView= factory2.inflate(R.layout.my_layout, null);
      //do other things...
      .setView(coloredChangedView);
      

      这样你可以自定义你的对话框..

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-04-05
        • 2014-02-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-02-22
        相关资源
        最近更新 更多