开发者

Android tablelayout design with image object

I want to design a table layout that contains 2 vertical textviews and an imageview at exactly front on this 2 textviews as shown in the image attached.

But I am not getting any way to design such a layout.

Please help how can I design this (see design shown in attached image) using table layout or any other layou开发者_开发百科t? Thanks.

Android tablelayout design with image object

http://www.freeimagehosting.net/1441f


Solution with table layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TableLayout
        android:layout_height="wrap_content"
        android:id="@+id/tableLayout1"
        android:layout_width="match_parent">
        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="10dip">
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Grilled Fish with Tangerine and..." />
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dip"
                    android:text="Quantity: 5" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:layout_weight="3">
            <ImageView
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:src="@drawable/icon"
                android:layout_gravity="right">
            </ImageView>
            </LinearLayout>
        </TableRow>
        <View
            android:layout_height="1dip"
            android:background="#FFFFFF" />
    </TableLayout>

</LinearLayout>

Have fun! :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜