首页 > 其他 > 详细

This tag and its children can be replaced by one <TextView/> and a compound drawable

时间:2015-04-29 13:11:31      阅读:295      评论:0      收藏:0      [点我收藏+]

 

技术分享
 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="fill_parent"
 4     android:layout_height="wrap_content"
 5     android:orientation="horizontal" >
 6     
 7     <ImageView 
 8         android:src="@drawable/ic_launcher"
 9         android:layout_width="wrap_content"
10         android:layout_height="wrap_content"
11         android:contentDescription="@drawable/ic_launcher"/>
12     
13     <TextView 
14         android:id="@+id/list_item_textview"
15         android:layout_width="wrap_content"
16         android:layout_height="fill_parent"
17         android:paddingLeft="20dp"/>
18 
19 </LinearLayout>
View Code

如果图片是直接引用drawable中的图片资源,可以直接在TextView中定义,

可直接替换为:

技术分享
 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="fill_parent"
 4     android:layout_height="wrap_content"
 5     android:orientation="horizontal" >
 6     
 7     <TextView 
 8         android:id="@+id/list_item_textview"
 9         android:layout_width="wrap_content"
10         android:layout_height="fill_parent"
11         android:drawableLeft="@drawable/ic_launcher"
12         android:drawablePadding="20dp"/>
13 
14 </LinearLayout>
View Code

 

This tag and its children can be replaced by one <TextView/> and a compound drawable

原文:http://www.cnblogs.com/luow/p/4465434.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!