You need to create a custom layout with two FrameLayout
like this . So the Ads
will be at the bottom with a fixed height and ListView
Fragment
will use the remaining height.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/list_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/Red"
android:layout_weight="1"/>
<FrameLayout
android:id="@+id/ads_container"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@color/Yellow"/>
</LinearLayout>
And add the Fragments
to each FrameLayout
like this
ListFragment = new FragmentTab1();
ft.add(R.id.list_container, ListFragment);
ft.attach(mFragment);
Fragment adfragment = new AdFragment();
ft.add(R.id.ads_container, adfragment);
ft.attach(adfragment);