2015-04-23 97 views
1

我已經創建了一個Android應用程序,因爲我在佈局設計中遇到了問題。佈局設計中的麻煩Android

請參閱佈局在此鏈路

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> 

感謝。

+0

發佈您的代碼。 – Raghavendra

+0

請詳細解釋一下你面臨的問題。並請在這裏發佈您的佈局XML文件代碼。在您提供的鏈接上,只有佈局圖像在那裏。 – codevscolor

+0

在圖像中,您可以看到產品圖像是ImageView,用戶圖像位於產品圖像和文本(120 KM ...)之間,所以如何管理這個 –

回答

1
<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來上面的代碼,並嘗試

+0

完成!謝謝。 –

+0

很高興知道:) – nvinayshetty