This tag and its children can be replaced by one <TextView/> and a compound drawable
2013-10-28 10:36
627 查看
写了这么一段代码:
<LinearLayout
android:orientation="horizontal"
android:layout_centerInParent="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<ImageView
android:id="@+id/grid_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/grid_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/app_name"/>
</LinearLayout>
eclipse提示: This tag and its children can be replaced by one <TextView/> and a compound drawable
最后发现原来可以直接给TextView加图片.. ,通过 setCompoundDrawable 方法, 或者直接在xml中使用android:drawableLeft.、android:drawableRight等属性指定!
<LinearLayout
android:orientation="horizontal"
android:layout_centerInParent="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<ImageView
android:id="@+id/grid_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/grid_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/app_name"/>
</LinearLayout>
eclipse提示: This tag and its children can be replaced by one <TextView/> and a compound drawable
最后发现原来可以直接给TextView加图片.. ,通过 setCompoundDrawable 方法, 或者直接在xml中使用android:drawableLeft.、android:drawableRight等属性指定!
相关文章推荐
- This tag and its children can be replaced by one <TextView/> and a compound drawable
- android This tag and its children can be replaced by one <TextView/> and a compound drawable 布局文件提示
- 关于 This tag and its children can be replaced by one <TextView/> and a compound drawable 的问题
- This tag and its children can be replaced by one <TextView/> and a compound drawable
- This tag and its children can be replaced by one <TextView/> and a compound drawable
- This tag and its children can be replaced by one <TextView/> and a compound drawable
- android xml文件中出现如下提醒:This tag and its children can be replaced by one <TextView/> and a compound drawable
- This tag and its children can be replaced by one <TextView/> and a compound drawable
- eclipse提示:This tag and its children can be replaced by one <TextView/> and a compound drawable
- eclipse提示:This tag and its children can be replaced by one <TextView/> and a compound drawable
- 【Android学习笔记】This tag and its children can be replaced by one <TextView/> and a compound drawable
- Android 开发 Tip 15 -- can be replaced by one <TextView/> and a compound drawable
- This tag and its children can be replaced
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- android.view.InflateException: <merge /> can be used only with a valid ViewGroup root and attachToRo
- MATLAB7.0安装后显示The element type "name" must be terminated by the matching end-tag "</name>".
- android.view.InflateException: <include /> can only be used inside of a ViewGroup
- [Err] 1075 - Incorrect table definition; there can be only one auto column and it must be defined as
- MATLAB7.0安装后显示The element type "name" must be terminated by the matching end-tag "</name>".