Sticky Footer Below Listview In Android Layout
I want to put an ad layout at the bottom of a ListView. I want it to stick to the bottom of the page and the listview almost scrolling going behind it. This is what I have and it
Solution 1:
Change attributes of your ListView
to :
<ListViewandroid:id="@android:id/list"android:layout_width="fill_parent"android:layout_height="0dp"android:layout_weight="1"android:longClickable="true" ></ListView>
EDIT: Also check that parent layout of your piece of code is LineareLayout
with attribute android:orientation="vertical"
Solution 2:
here is the solution of your problem
<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"xmlns:android="http://schemas.android.com/apk/res/android"><ListViewandroid:id="@+id/listView1"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_above="@+id/adView"android:layout_alignParentTop="true" ></ListView><com.google.ads.AdViewandroid:id="@+id/adView"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:layout_centerHorizontal="true"ads:adSize="BANNER"ads:loadAdOnCreate="true" ></com.google.ads.AdView></RelativeLayout>
Post a Comment for "Sticky Footer Below Listview In Android Layout"