화면을 2 개의 섹션으로 나누려고합니다. 위의 섹션은지도 위젯입니다. 다음은 위젯으로 채워진 다른 레이아웃입니다. 문제는지도 위젯이 전체 화면을 채우는 것입니다. 지도 아래의 레이아웃을 어떻게 만들 수 있습니까?Android 레이아웃 우선 순위
지도 위젯에 높이를 부여하여 해결할 수 있다고 생각하지만 매우 유연하지는 않습니다.
내이 시도 :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:apiKey="my api key" />
<RelativeLayout
android:id="@+id/map_menu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/mapview"
android:background="@drawable/locatie_background" >
<Button android:id="@+id/firstButtonId" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/action_ready"
/>
</RelativeLayout >
</RelativeLayout>
다음을 시도해보십시오. RelativeLayout에서 android : layout_weight = "1" 나는 그것이 당신의 문제를 해결할 것이라고 생각한다. –
@ 카틱 아니, 그렇지 않을 것이다. 'layout_weight'는'RelativeLayout'에 의해 무시됩니다. –
팁 주셔서 감사. 부모 레이아웃을 linearLayout으로 변경하려고 했으므로 두 번째 상대 레이아웃에 가중치를 할당 할 수 있습니다. 하지만 같은 결과를 내고 있습니다. – Vincent