Reputation: 1347
How do I make my ads display at the bottom of the screen?
I have tried setting gravity to bottom but it still won't budge.
Current page code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/Background_Color">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:myapp="http://schemas.android.com/apk/res/com.x.x" >
<TextView android:id="@+id/out_text"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:textSize="30dip"
android:textColor="@color/Text_Color" />
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
myapp:refreshInterval="10"
android:visibility="visible" />
</LinearLayout>
</ScrollView>
Any help would be greatly appreciated!
Upvotes: 0
Views: 2870
Reputation: 5622
Try adding a weight to your TextView.
android:layout_weight="1"
This means, it will take up any open space of the parent.
And add this to the ScrollView:
android:fillViewport="true"
Upvotes: 2
Reputation: 134664
Try using a RelativeLayout instead, and give the AdView an attribute of android:layout_alignParentBottom="true"
.
Also, gravity only affects the content, layout_gravity affects the view itself. (You may know that, just pointing it out)
Upvotes: 2