样式化的DatePicker [英] Styling the DatePicker

查看:122
本文介绍了样式化的DatePicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在拼命的风格在Android 3.2的文字大小和颜色。当试图与覆盖默认样式

I have been trying very hard to style the text size and colour on android 3.2. When attempting to override the default style with

<item name="android:numberPickerInputTextStyle">@style/numberPickerInputText</item>

我总是得到这个错误:

I always get this error:

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

为什么会这样?我是pretty确信我选择了正确的样式覆盖(从平台13 API文件夹挖吧)

Why is this so? I am pretty sure I selected the correct style to override (dug it from the platform 13 API folder)

我在这些地方看起来..好像它不能得到帮助!

I looked in these places.. seems like it cant be helped!

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

<一个href=\"http://stackoverflow.com/questions/6738502/no-resource-found-that-matches-the-given-name-androidstyle-alertdialog-error\">No资源发现匹配给定名称'@android:风格/ AlertDialog'了最新的Andr​​oid 3.2的SDK更新后的错误

下面这篇博客说了些关于导入的样式合并到我的应用程序。它应该如何办呢?例子吗?

This blog below said something about importing the styles into my application. How is it supposed to be done? examples?

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

可有人请点我朝着正确的方向?谢谢!

Can someone please point me to the right direction? Thanks!

推荐答案

快速和肮脏的方式..应用它,你显示对话框后。不是一个很好的解决方案,但它的工作原理..还在寻找其他的解决办法:)

Quick and dirty way.. apply it after you show the dialog. Not a good solution but it works.. still looking for other solutions :)

//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);
    }       
}

这篇关于样式化的DatePicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆