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
  • 相关阅读:
    【CF1015D】Walking Between Houses(构造,贪心)
    【CF1068D】Array Without Local Maximums(计数DP)
    【CF1068C】Colored Rooks(构造)
    172.处理机控制与杂项指令
    171.控制转移指令
    170.串处理指令
    169.逻辑指令
    168.算术指令
    Volume 1. Big Number(uva)
    Volume 1. String(uva)
  • 原文地址:https://www.cnblogs.com/luow/p/4465434.html
Copyright © 2011-2022 走看看