Ответ 1
Вы можете сделать это, используя RelativeLayout
, не занимаясь хакерскими вещами:
<?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">
<bla.bla.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#FF0000"/>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/ad"/>
</RelativeLayout>
Если объявление не загружается по какой-то странной причине, ListView
займет все свободное место. С другой стороны, если объявление действительно загружается, ListView
не будет перекрываться объявлением.