【问题标题】:Styling the DatePicker样式化 DatePicker
【发布时间】:2011-11-22 08:41:06
【问题描述】:

我一直在努力在 android 3.2 上设置文本大小和颜色的样式。尝试使用

覆盖默认样式时
<item name="android:numberPickerInputTextStyle">@style/numberPickerInputText</item>

我总是收到这个错误:

error: Error: No resource found that matches the given name: attr 'android:numberPickerInputTextStyle'.

为什么会这样?我很确定我选择了正确的样式来覆盖(从平台 13 API 文件夹中挖出来)

我看了这些地方..好像没办法了!

http://code.google.com/p/android/issues/detail?id=18659#c8

No resource found that matches the given name '@android:style/AlertDialog' error after the latest android 3.2 sdk update

下面的这篇博客谈到了将样式导入我的应用程序。应该怎么做?例子?

http://daniel-codes.blogspot.com/2011/08/new-to-android-more-style-restrictions.html

有人可以指点我正确的方向吗?谢谢!

【问题讨论】:

    标签: android


    【解决方案1】:

    快速而肮脏的方式..在显示对话框后应用它。不是一个好的解决方案,但它有效..仍在寻找其他解决方案:)

    //Should'nt be here but well..
    public static void changeDialogTextSize(Dialog dialog) {
        TextView tvMessage = (TextView)dialog.findViewById(android.R.id.message);
        if (tvMessage != null)
        {
            tvMessage.setTextSize(25f);
            tvMessage.setTextColor(Color.WHITE);
        }       
    }
    

    【讨论】:

      猜你喜欢
      • 2010-11-21
      • 2016-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      相关资源
      最近更新 更多