Do all widgets in an Android layout file require layout_width and layout_height ?

Posted by Eno on Stack Overflow See other posts from Stack Overflow or by Eno
Published on 2010-03-30T19:03:16Z Indexed on 2010/03/30 19:13 UTC
Read the original article Hit count: 381

Filed under:
|
|

I have a ListView composed of LinearLayouts. Inside each is an ImageView, TextView and another ImageView laid out horizontally:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >
            <ImageButton
                android:id="@+id/thumbnail"
                android:background="@color/white"
                android:paddingTop="10dip"
                android:paddingLeft="8dip"
                android:paddingBottom="10dip"
                />
            <TextView
                android:id="@+id/title"
                android:background="@color/white"
                android:textColor="@color/bntext"
                android:paddingTop="10dip"
                android:paddingLeft="8dip"
                />
            <ImageButton
                android:src="@drawable/green_arrow_small"
                android:background="@color/white"
                />
</LinearLayout>

© Stack Overflow or respective owner

Related posts about android

Related posts about layout