Tag: checkedtextview

android:CheckedTextView不能被检查?

最初我想要复选标记左侧的文字。 在这个网站search后,我发现最好的解决方法是android:CheckedTextView? 但是,我发现这个复选标记不能被用户手动改变。 是由devise? <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/autoupdatecheckboxview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:paddingLeft="6dip" android:paddingRight="6dip" android:text="Pop up a message when new data available" android:typeface="sans" android:textSize="16dip"/>

重写引用的样式属性

阅读引用主题属性后,我想引用我设置的自定义主题中的属性的值。 我正在将一个用户定义的样式应用于CheckedTextView <CheckedTextView android:id="@+id/contactInfo" style="@style/ListViewCheckedTextViewRowStyle" > </CheckedTextView> 用户定义的样式被定义为: <style name="ListViewCheckedTextViewRowStyle" parent="@style/ListViewRowStyle"> <item name="android:checkMark">?android:listChoiceIndicatorMultiple</item> </style> 我创build的主题定义为: <style name="Theme.Yellowgreen" parent="android:Theme.Holo.Light.DarkActionBar"> <item name="android:listChoiceIndicatorMultiple">@drawable/btn_check_holo_light</item> </style> 但是,显示的checkMark样式是设备的默认主题可绘制的,而不是我用户定义的可绘制的。 我可以绘制我的drawable的唯一方法是: <style name="ListViewCheckedTextViewRowStyle" parent="@style/ListViewRowStyle"> <item name="android:checkMark">@drawable/btn_check_holo_light</item> </style> 但是这样做会挫败覆盖这个属性的全部目的,特别是因为我想在多个主题中覆盖这个属性。 我在我的Activity的onCreate()方法中设置主题,如下所示: public void onCreate(Bundle savedInstanceState) { this.setTheme(R.style.Theme_Yellowgreen); super.onCreate(savedInstanceState); // … } 我也尝试在AndroidManifest.xml文件中设置主题,如: <application android:theme="@style/Theme.Yellowgreen" > 但是这没有用。 有什么可能会出错? 更新 我刚刚创build了一个小样本项目,看起来像我上面张贴的代码正在工作。 所以我必须有一些其他的风格,这是覆盖这个属性,也许它必须做我的布局XML文件。 在我的大型项目中,我有一个Activity两个Fragments 。 这两个Fragments都有Adapters支持的Listviews 。 在Fragment […]