This tag and its children can be replaced by ~~~
这是我的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical" >
<!-- 书封 -->
<ImageView
android:id="@+id/listview_grid_layout_iv_bookicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@null" />
<!-- 书名 -->
<TextView
android:id="@+id/listview_grid_layout_tv_bookname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</LinearLayout>
eclipse提示:This tag and its children can be replaced by one <TextView/> and a compound drawable
最后发现原来可以直接给TextView加图片.. ,通过setCompoundDrawable 方法, 或者直接在xml中使用android:drawableLeft.、android:drawableRight等属性指定。
更多相关文章
- Android的日积月累-问题解决
- Android(安卓)JUnit单元测试基础实例
- Android(安卓)APP 启动优化(冷启动)
- android软键盘遮挡布局
- android > ListView > 加载 网络/assets图片
- Android(安卓)TTS实现简单阅读器(一)
- Android(安卓)软键盘顶起布局相关
- Android(安卓)程序 LinearLayout布局 参数layout_weight 探讨
- 《Android(安卓)UI基础教程》之读书笔记