如何使我的广告显示在屏幕底部?
我试过把重力调到最低,但它仍然不动。
当前页面代码:
<?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>任何帮助都将不胜感激!
发布于 2011-01-26 03:07:24
尝试向TextView添加权重。
android:layout_weight="1"这意味着,它将占用父级的任何开放空间。
并将此代码添加到ScrollView中:
android:fillViewport="true"发布于 2011-01-26 03:07:44
请尝试使用RelativeLayout,并为AdView提供android:layout_alignParentBottom="true"属性。
另外,重力只会影响内容,layout_gravity会影响视图本身。(你可能知道这一点,只要指出它)
https://stackoverflow.com/questions/4797696
复制相似问题