zoukankan      html  css  js  c++  java
  • This tag and its children can be replaced by one <TextView/> and a compound drawable

     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
  • 相关阅读:
    scala 中的修饰符
    scala 主从构造器
    scala 伴生对象与伴生类
    scala 通过apply创建类的对象
    kali linux 全版本(以前的版本)镜像下载
    install python in wine
    SSH防爆破脚本
    SSH私用私钥登陆
    linux 内核提权
    Windows下MYSQL读取文件为NULL
  • 原文地址:https://www.cnblogs.com/luow/p/4465434.html
Copyright © 2011-2022 走看看