Я разработал один макет, который имеет всего 4 RelativeLayout - это внешняя обложка, а 3 - это ребенок. Когда я помещаю белый цвет во внешнюю компоновку, не оставляя пробелов, но когда я помещаю 9patch-изображение в качестве изображения с возможностью рисования, чем остальное заполнение/маржа по умолчанию. Есть ли какие-либо проблемы, которые решают проблему заполнения/поля? Я попробовал запас отрицательный, но он будет скрывать разрядное расположение Я думаю, что это не правильное решение, вот мой макетAndroid RelativeLayout Проблемы с дизайном
, когда я положил белый цвет в качестве фона, чем мой макет выглядеть
Здесь есть следующий код моего макета
<RelativeLayout
android:id="@+id/DetailSection1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/HeaderLayout"
android:layout_toLeftOf="@+id/DetailSection2"
>
<TextView
android:id="@+id/lblRestaurantName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/DetailSection1"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:textColor="@color/heding_font"
android:textSize="@dimen/headingFont"
android:text="Restaurant Name" />
<ImageView
android:id="@+id/imgpin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/lblRestaurantName"
android:layout_margin="5dp"
android:src="@drawable/pin" />
<TextView
android:id="@+id/lblAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lblRestaurantName"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/imgpin"
android:text="Address"
android:textColor="@color/restaurant_list_font"
android:textSize="@dimen/lableNormalFont"
/>
<ImageView
android:id="@+id/imgphone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/lblAddress"
android:layout_margin="5dp"
android:src="@drawable/phn" />
<TextView
android:id="@+id/lblMobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lblAddress"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/imgphone"
android:text="Mobile"
android:textColor="@color/restaurant_list_font"
android:textSize="@dimen/lableNormalFont"
/>
<ImageView
android:id="@+id/imgstar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/lblMobile"
android:layout_margin="5dp"
android:src="@drawable/star" />
<TextView
android:id="@+id/lblStar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lblMobile"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/imgstar"
android:text="Star"
android:textColor="@color/restaurant_list_font"
android:textSize="@dimen/lableNormalFont"
/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/DetailSection2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignBottom="@+id/DetailSection1"
android:layout_toLeftOf="@+id/DetailSection3"
android:layout_toRightOf="@+id/lblStar" >
<ImageView
android:id="@+id/imgmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:src="@drawable/read_more" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/DetailSection3"
android:layout_width="95dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/HeaderLayout"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:background="@drawable/photo_cover" >
<ImageView
android:id="@+id/imgRestaurant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/lblMobile"
android:layout_margin="5dp"
android:src="@drawable/rihanna" />
</RelativeLayout>
</RelativeLayout>
не могли бы вы разместить 9-патч, который вы используете, –
Вы попробовали дать корень RelativeLayout width = fillparent и тот же для высоты. – Prateek
Спасибо! Archie.bpgc Я отредактировал мой вопрос с 9 патчами image –