I just started coding a new application for Android and stumble over a warning.
This tag and its children can be replaced by one and a compound drawable
Another problem I have is the image placed on the right side. How can I do this without having trouble with layout_wight? See image ([2], yellow and green highlight).
I would like to follow the android design guide and prevent warnings. So how do I solve this? Actual my code looks like:
<LinearLayout
android:id="@+id/mainTitleLinearLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal" >
<ImageView
android:id="@+id/mainTitleImageView"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="8dp"
android:src="@drawable/ic_launcher"
android:contentDescription="@string/app_name"/>
<TextView
android:id="@+id/mainTitleTextView"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:gravity="left|center_vertical"
android:paddingBottom="4dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="4dp"
android:text="@string/app_name"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout android:layout_width="match_parent" android:layout_height="2dp" android:background="#0099CC"></LinearLayout>
Do you guys know some good tutorials for building custom components so I do not get this error again or/and solve the placement problem?
1 http://developer.android.com/design/style/metrics-grids.html

That’s not an error, just an information (or a warning) that there is a more efficient way to achieve a row in the layout consisting of an image and a text view. You can do it like this:
The drawableLeft attribute adds the given drawable to the left of the text view. In a similar way you can place the image to the right.
However, you will not be able to fine tune the position of the image wrt. the text view.