CheckedTextView的显示问题
今天测试CheckedTextView竟然不显示
<CheckedTextView
android:id="@+id/ctv_checktext"
android:layout_width="fill_parent"
android:paddingLeft="2px"
android:paddingRight="2px"
android:paddingTop="2px"
android:layout_height="wrap_content"
/>
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
利用上面的设置竟然不显示
查看了一下 在属性里面竟然要:
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
Reference1:
http://stackoverflow.com/questions/2354488/checkedtextview-set-to-checked-oncreate-in-listview
setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
, you need to use the
setSelection()
method onListView
to indicate which get checked
Reference2:
Q: 如果要把CheckedTextView这个控件集成到一个listactivity中,如何判断各行的text被checked?
A:
CheckedTextView vs = (CheckedTextView)listView.getChildAt(0);
Log.d("-----", vs.isChecked() + "");
更多相关文章
- android tab上显示数字
- Android视图篇之一:Android常见基本布局
- android 消息提醒(Toast,Notification)
- Xamarin.Android中使用android:onClick="xxx"属性
- ImageView的scaletype属性
- android布局属性详解-大杂烩
- ImageView的属性android:scaleType,即ImageView.setScaleType(Ima
- ImageView的属性android:scaleType,即ImageView.setScaleType(Ima
- layout布局属性、标签属性总结大全