RelativeLayout android: layout_height = "fill_parent" проблема - PullRequest
0 голосов
/ 05 июля 2011

У меня есть RelativeLayout, в котором я пытаюсь расположить кнопку посередине, а блок adMob внизу.Для меня код должен работать нормально, и элементы располагаются там, где они должны быть в относительной разметке, но кажется, что относительная разметка не заполняет весь экран, как следует, когда я использую android: layout_height = "fill_parent" вотносительное расположение родителей.

<?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"
    android:background="@drawable/background"
    android:gravity="center_vertical"
    android:id="@+id/mainLayout">
  <ImageButton android:id="@+id/startbutton" android:src="@drawable/scanmenubutton" android:layout_height="wrap_content" android:layout_width="wrap_content" android:background="@null" android:layout_centerHorizontal="true" android:layout_centerVertical="true"></ImageButton>
  <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/admobLayout" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true"></RelativeLayout>
</RelativeLayout>
...