2015-04-23 105 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