Layoutopt tool output value

I use layoutopt as 'layoutopt layout.xml'

And I get this message:

9:18 This tag and its children can be replaced by one <TextView/> and a compound drawable
28:78 Use an android:layout_height of 0dip instead of wrap_content for better performance

But I don’t understand the point, can anyone clarify to me the meaning of this

use 0dip for what? on the layout? I want my layout not to wrap content up to size zero

<LinearLayout android:id="@+id/linearLayout3"
   android:layout_width="fill_parent" android:layout_height="0px"
   android:layout_alignParentTop="true" android:background="#30000000"
   android:padding="5dip">

   <ImageView android:id="@+id/imageView1"
      android:layout_width="wrap_content" android:layout_height="wrap_content"
      android:background="@drawable/bzz_icon"></ImageView>

   <TextView android:layout_width="fill_parent" android:id="@+id/textView1"
      android:textColor="#FFFFFF" android:layout_height="wrap_content"
      android:layout_gravity="center" android:gravity="left"
      android:layout_marginLeft="15dip" android:text="@string/title"
      android:textSize="20sp"></TextView>

</LinearLayout>
+3
source share
2 answers

The first post says that you can linearLayout3only replace TextViewand use android:drawableLeftinstead ImageView.

, , , 28 layout_height 0dp wrap_content. layout_weight, . , XML-, 28, .

+4
TextView with the left image and the text is centered

  <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center|left"
            android:drawableLeft="@drawable/ic_launcher"
            android:text="@string/hello" />
0

All Articles