布局设计问题 Android

Trouble in Layout design Android

我创建了一个 Android 应用程序,因为我在布局设计方面遇到问题。

请参阅此 link-

中的布局

https://lh6.googleusercontent.com/WJRLolp6PVoKskRBdFH6VMmdqftSgt10EZhd-A1h_glblYoJjVrF8bYjsPXmw752sGttlzIh7IHwtQo=w1342-h479

我的代码:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <ImageView
            android:id="@+id/product_image"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/product" />

        <TextView
            android:id="@+id/price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/product_image"
            android:layout_alignParentRight="true"
            android:text="Price"
            android:textAppearance="?android:attr/textAppearanceLarge" />
    </RelativeLayout>

    <ImageView
        android:id="@+id/user_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/userimage" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/distance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Distance"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Time"
            android:textAppearance="?android:attr/textAppearanceMedium" />
    </LinearLayout>
</LinearLayout>

谢谢。

您可以为此使用相对布局

您可以自定义布局

http://www.vogella.com/tutorials/AndroidCustomViews/article.html

    <ImageView
    android:id="@+id/user_image"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="5dp"
    android:layout_marginTop="-25dp"
    android:src="@drawable/ic_launcher" />

将用户图像xml更改为上面的代码并尝试