设置Theme.Holo.Light改变了一切,除了列表中的复选框 [英] Setting Theme.Holo.Light changes everything except checkboxes in list

查看:173
本文介绍了设置Theme.Holo.Light改变了一切,除了列表中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<style name="CustomTheme" parent="@android:style/Theme.Holo.Light">

我做我自己的主题,在我的清单添加到它的参考。一切看起来除了在我的自定义列表复选框完美(按钮,文本框等)。

I made my own theme and added a reference to it in my manifest. Everything looks perfect (buttons, textboxes etc) except for the checkboxes in my custom list.

    android:checkMark="?android:attr/listChoiceIndicatorMultiple"

在我的列表项的复选框从Theme.Holo默认复选框,我想不出为什么。

The checkbox in my listitem is the default checkbox from Theme.Holo and I can't figure out why.

感谢您的帮助!

推荐答案

我有同样的问题。我不知道为什么它不选择正确的复选框 - 你可以勉强看到它在浅色背景。现在,我复制了适当的光全息图像的复选框出了android绘制文件夹,进入我的项目。然后,我创建了自己的所引用这些图像。按钮属性到我的新选择的xml:我那么Android的设置。我选择XML看起来是这样的:

I am having the same problem. I have no idea why it isn't choosing the correct checkbox - you can barely see it on the light background. For now, I copied the appropriate holo light checkbox images out the of the android drawable folders and into my project. I then created my own that referenced these images. I then set the android:button attribute to my new selector xml. My selector xml looks like this:

<selector xmlns:android="http://schemas.android.com/apk/res/android" >
        <item android:state_checked="true" android:state_focused="true"
                android:drawable="@drawable/btn_check_on_focused_holo_light" /> 
        <item android:state_checked="false" android:state_focused="true"
                android:drawable="@drawable/btn_check_off_focused_holo_light" />
        <item android:state_checked="false"
                android:drawable="@drawable/btn_check_off_holo_light" />
        <item android:state_checked="true"
                android:drawable="@drawable/btn_check_on_holo_light" />
</selector>

请确保您复制所有不同的密度图像(xhdpi,华电国际等)到项目中。

Make sure you copy all of the different density images (xhdpi, hdpi, etc.) into your project.

这篇关于设置Theme.Holo.Light改变了一切,除了列表中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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