This tag and its children can be replaced by one <TextView/> and a compound drawable
and gt by be lt this can One
2023-09-11 14:18:01 时间
写了这么一段代码:
- <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等属性指定!
相关文章
- android xml文件中出现如下提醒:This tag and its children can be replaced by one <TextView/> and a compound drawable
- [Cypress] Change a viewport width and height in a cypress test
- [Tools] Scroll, Zoom, and Highlight code in a mdx-deck slide presentation with Code Surfer <🏄/>
- [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
- android xml文件中出现如下提醒:This tag and its children can be replaced by one <TextView/> and a compound drawable
- [Angular Directive] Structure directive and <template>
- [React] Unit Testing with React and webpack
- One order error message log and storage
- atitit.软件gui按钮and面板---os区-----软链接,快捷方式
- atitit.避免NullPointerException 总结and 最佳实践 o99
- AI:2020年6月23日北京智源大会演讲分享之智能信息检索与挖掘专题论坛——09:55-10:40刘兵教授《Open-World AI and Continual Learning》
- left_and_right_net正常版本
- UNIX 设计哲学:Do one thing and do it well
- Best Time to Buy and Sell Stock
- 论文解读(GGD)《Rethinking and Scaling Up Graph Contrastive Learning: An Extremely Efficient Approach with Group Discrimination》
- CF Mike and Feet (求连续区间内长度为i的最小值)单调栈