This tag and its children can be replaced by one <TextView/> and a compound drawable
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <ImageView
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@drawable/ic_launcher"/> <TextView
android:id="@+id/list_item_textview"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="20dp"/> </LinearLayout>
如果图片是直接引用drawable中的图片资源,可以直接在TextView中定义,
可直接替换为:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <TextView
android:id="@+id/list_item_textview"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="20dp"/> </LinearLayout>
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开发的时候,写了这样的一段代码: <?xml version="1.0" encoding="utf-8"?> <Li ...
- android xml文件中出现如下提醒:This tag and its children can be replaced by one <TextView/> and a compound drawable
第一个感叹号 是跟你说 让你把Imageview 和textview 结合起来 只用 textview textview有个属性叫 android:drawable...(top/bottom/.. ...
- Android little error records
1:在清单文件(Manifest)中加入权限时要注意,如下例: <uses-permission android:name="android.permission.CHANGE_NET ...
- TextView & EditText
TextView 1.下划线 textView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线 2.单独做第一步,文字会出现锯齿,要加下 ...
- Android常见布局问题
原文链接:http://www.cnblogs.com/Birdmafly/p/3809802.html 好久没写博了,因为最近在忙着做一个app,实在是没有时间.现在快完工了.想着还是把这个布局问题 ...
- Android tips tool 发现的性能问题(转载翻译)
先翻译刚好在研究到的一段,其余的无限期待续. 1.ObsoleteLayoutParam不起作用的标签 Invalid layout param in a LinearLayout: layout_c ...
- [置顶] Android开发笔记(成长轨迹)
分类: 开发学习笔记2013-06-21 09:44 26043人阅读 评论(5) 收藏 Android开发笔记 1.控制台输出:called unimplemented OpenGL ES API ...
- andorid lint
(一)Lint简介 Android SDK提供了一个代码扫描工具,称为lint.可以帮助您轻松地识别并纠正问题与结构质量的代码,不必执行应用程序或编写任何测试用例.每个问题检测到该工具报告的一个描述消 ...
- eclipse lint工具介绍
一.基本介绍 作为移动应用开发者,我们总希望发布的apk文件越小越好,不希望资源文件目录中没有用到的图片等资源也被打包进apk,不希望应用中使用了高于minSdk的api,也不希望AndroidMan ...
随机推荐
- jQuery 选择器 (基础恶补之三)+Ajax
jQuery load() 方法 jQuery load() 方法是简单但强大的 AJAX 方法. load() 方法从服务器加载数据,并把返回的数据放入被选元素中. 语法: $(selector). ...
- Python基础第二篇
一.三元运算 if True: name='a' else: name='b' #上面的代码用三元运算表示: name="a" if True else "b" ...
- C#写WPF程序,SQLSever2008 提示插入数据成功,却查询不到数据
1.提示存储成功,但是数据库中没有数据.今天在用C#写一个wpf程序时,要向数据库Sql server2008 中插入数据,程序提示成功,但打开数据库却没有值; 经过查询发现,数据存储到默认路径下的数 ...
- ajax 代码
function ajax(){ var aj=null; if(window.ActiveXObject){ aj = new ActiveXObject("Microsoft.XMLHT ...
- Checkpoint--与lazy writer区别
checkpoint目的是减少数据库的恢复时间(服务奔溃或重启服务后的恢复),而lazy writer的目的是保证SQL OS 有空闲缓存块和系统有一定可用内存. Checkpoint和lazyWri ...
- JS部分代码分享
2015-10-12 : 1.search()表达式:搜索索引 <!DOCTYPE html><html><body> <p>搜索字符串 "w ...
- 关于F12的有效利用
1.之前仅用F12查看页面的代码: 2.现在发现用F12可以查看css文件: 3.比如看到页面背景为黑色,然后在css里面把背景从黑色调成白色:
- svn server
svn server: 1.c:\Program Files\TortoiseSVN\bin>svnserve -d -r C:\Jasper\Repositories2.change the ...
- mac 激活Ultra Edit16
一.文本编辑器UltraEdit 参照Ultra Edit16.10 Mac 破解下载,或者官方下载 Ultra Edit16即可 printf of=/Applications/UltraEdit. ...
- VM安装mac及dmg文件转换iso
今天心血来潮,突然看见一篇关于swift的入门教程,但是前提是有一台mac啊,于是对于屌丝,就只好装黑苹果或者是虚拟机上运行了,但是呢mac貌似听说(没用过)只能在inter上运行,屌丝的本子偏偏是A ...