在android中使用CheckedTextView需要帮助吗
我的layout.xml文件中包含以下内容:在android中使用CheckedTextView需要帮助吗,android,Android,我的layout.xml文件中包含以下内容: <CheckedTextView android:id="@+id/checktext" android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:textAppearance="?android:attr/textAppearanceLarge" an
<CheckedTextView
android:id="@+id/checktext"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingLeft="6dip"
android:paddingRight="6dip"
/>
它不会显示所选的“单选按钮”。我已经通过源代码,它执行'numberView2.setSelected(true);',但它仍然不显示选中的单选按钮
你能告诉我为什么吗?我该如何解决我的问题。你确定不想让setChecked而不是setSelected吗?为什么要使整个父视图无效,而不仅仅是
numberView2
?我不知道。我想尽一切办法让它发挥作用。
CheckedTextView numberView2 = (CheckedTextView) v.findViewById(R.id.checktext);
numberView2.setSelected(true);
v.invalidate();