所以我正在创建这个应用程序,它将在网格中显示产品,例如在 nexus 7 纵向视图中,每行 2 个,而在横向模式下,将连续 4 个。每个产品都有一个想象,然后它下面的几个文本视图显示一些信息。
然而,显示免费送货和特价数量的最后两个文本视图似乎与下面的下一张图片重叠。谁能帮我指出我哪里出错了。布局如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="200dp"
android:layout_height="200dp"
android:background="@drawable/product_grid_lister_image_background"
android:padding="1dp" >
<ProgressBar
android:id="@+id/image_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminateDrawable="@drawable/progress_blue" />
<ImageView
android:id="@+id/product_grid_lister_image"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_margin="10dp"
android:scaleType="center"/>
</RelativeLayout>
<RatingBar
android:id="@+id/product_grid_lister_rating_bar"
style="@style/GoldRatingBar.Large"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginTop="5dp"
android:numStars="5" />
<TextView
android:id="@+id/product_grid_lister_product_name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="2"
android:includeFontPadding="false"
android:textColor="@color/black"
android:textSize="@dimen/text_dp_14pt" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/product_grid_lister_price_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/black"
android:textSize="@dimen/text_dp_20pt" />
<TextView
android:id="@+id/product_grid_lister_was_price_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/product_grid_lister_price_text"
android:includeFontPadding="false"
android:textColor="@color/grey"
android:textSize="@dimen/text_dp_14pt" />
<TextView
android:id="@+id/product_grid_lister_offer_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/product_grid_lister_was_price_text"
android:includeFontPadding="false"
android:textColor="@color/red"
android:textSize="@dimen/text_dp_14pt" />
<TextView
android:id="@+id/product_grid_lister_special_offer_text"
style="@style/plp_special_offer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/product_grid_lister_offer_text"
android:includeFontPadding="false"
android:text="@string/plp_special_offer" />
<TextView
android:id="@+id/product_grid_lister_delivery_offer_text"
style="@style/plp_special_offer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/product_grid_lister_special_offer_text"
android:includeFontPadding="false"
android:text="@string/plp_delivery_offer" />
<CheckBox
android:id="@+id/product_grid_lister_star_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:paddingLeft="6dp"
android:button="@drawable/product_grid_star_checkbox"
android:focusable="false" />
</RelativeLayout>
</LinearLayout>