我有一个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() method和Child selection in ExpandableListView但没有工作!
如果因为覆盖了singleChoice复选标记而被放置在左侧而不是右侧,那么如何解决这个问题呢? 提前致谢