单一选择的可扩展列表视图获取选定的子项不起作用

时间:2014-06-05 11:29:30

标签: android expandablelistview navigation-drawer

我有一个singleChoice可扩展列表视图,选项在左侧显示复选标记,如下所示

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/childElementSingleChoice"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:drawableLeft="?android:attr/listChoiceIndicatorSingle"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:textAppearance="?android:attr/textAppearanceMedium" />

为此,我们选择时未显示选中的选项,因此我在setChecked中添加了onChildClick

通过从defaulPrreference读取,我想将正在检查的视图填充到从首选项获得的位置。

使用setSelectedChild(0,0,true)无效。

我已经尝试了the ExpandableListView ignore SetSelectedChild() methodChild selection in ExpandableListView但没有工作!

如果因为覆盖了singleChoice复选标记而被放置在左侧而不是右侧,那么如何解决这个问题呢? 提前致谢

0 个答案:

没有答案