【发布时间】:2009-11-03 19:31:07
【问题描述】:
我的 layout.xml 文件中有以下内容:
<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"
/>
它显示了“单选按钮”,但是当我调用 onClickListener() 时?
CheckedTextView numberView2 = (CheckedTextView) v.findViewById(R.id.checktext);
numberView2.setSelected(true);
v.invalidate();
它没有显示选中的“单选按钮”。我已经通过源代码单步执行,它确实执行了“numberView2.setSelected(true);”,但它仍然没有显示选中的单选按钮。
你能告诉我这是为什么吗?我该如何解决我的问题。
【问题讨论】:
-
你为什么要使整个父视图无效,而不仅仅是
numberView2? -
我不知道。我想尽一切办法让它发挥作用。
标签: android