CheckedTextView的使用、学android疯狂讲义第二版遇到的问题希望能帮到和我一样的初学者、新手

来源:互联网 发布:数据运营 编辑:程序博客网 时间:2024/04/30 09:14

跟着android疯狂讲义敲到69页,使用到<CheckedTextView>时:

<CheckedTextView      android:layout_width="match_parent"     android:layout_height="wrap_content"      android:text="@string/text"     android:checkMark="<span style="color: rgb(255, 0, 0); font-size: 14px;">@drawable/ok</span>" />

最后一句 android:checkMark="@drawable/ok"将勾选的按钮改为图片,当我在使用时应为随便用了张图片得到的结果让我很是不理解。得不到我想要看到的结果

这是个可勾选的文本但是我点击了没反应,于是我上百度找了下资料。

以下是我查询资料后得到的结果:

<span style="font-family:Arial;font-size:12px;background-color: rgb(255, 255, 255);"><CheckedTextView      android:layout_width="match_parent"     android:layout_height="wrap_content"      android:text="@string/text"     android:checkMark="?android:attr/listChoiceIndicatorMultiple" /></span>

只要将最后一句改成  android:checkMark="?android:attr/listChoiceIndicatorMultiple"就能看到可选框后面的小勾勾了。


新手学习,经验分享!!!




0 0
原创粉丝点击