안녕하세요 저는 Android 레이아웃을 사용하여 벨로우즈 (그림 첨부)와 같은 UI를 만들어야합니다. 머리글, 바닥 글 및 중간 영역이 이미지보기와 함께 표시됩니다. 영역 A와 영역 C 유사한 높이 (화면 20 %)이고, 이미지보기 Android 레이아웃은 다른 두 레이아웃의 중간에 레이아웃을 배치합니다
나의 현재 XML 코드는 다음과 같이 인 영역 B 및 영역 (C)의 중앙에 반드시 배치되어야한다 화상에있어서
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:id="@+id/show_contact_bottomArea"
android:layout_width="match_parent"
android:layout_height="120dp"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
<LinearLayout
android:id="@+id/show_contact_middleArea"
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="vertical"
android:background="@color/grayContact"
android:layout_below="@+id/show_contact_headerArea"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="@+id/show_contact_bottomArea">
</LinearLayout>
<LinearLayout
android:id="@+id/show_contact_headerArea"
android:layout_width="match_parent"
android:layout_height="120dp"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"></LinearLayout>
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
app:srcCompat="@drawable/common_google_signin_btn_icon_dark_focused"
android:id="@+id/imageView2"
android:layout_marginBottom="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
나는
marginBot했다 tom = "40dp"
이미지 뷰는 위쪽으로 밀어내는 것이 좋지 않습니다. 영역 B와 영역 C의 경계 중앙에 이미지보기를 배치하는 가장 좋은 방법은 무엇입니까? A 지역 & 지역 B의 높이 layout_height = "120dp"
하지만 이상적으로 모두 방법 화면의 20 % (각)해야한다 :
또한 현재 나는
안드로이드를 준 그것도 달성할까요? 예에 대한 정확한 영역의 부분과 프레임 레이아웃 를주는
framelayout을 사용하십시오. 이러한 종류 또는 요구 사항에 대한 유연한 대답 – Stallion