0

我设置了一个LinearLayoutwithadmobWebView。当admob出现在顶部时,WebView Y pos正确地重新定位到0 + adMobHeight

然后,如果您触摸并拖动WebView,您可以移动垂直相同的 admob 高度!iOS 上的这个属性称为bounces.

如何停用它?

如果不可能,在不WebView重新加载内容的情况下强制重新计算其大小?谢谢

请注意,卷轴已经被禁用,

    webviewB.setVerticalScrollBarEnabled(false);
    webviewB.setHorizontalScrollBarEnabled(false);
4

1 回答 1

0

如果您总是想在屏幕顶部显示,那么您可能需要考虑使用RelativeLayout。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

  <com.admob.android.ads.AdView
  android:id="@+id/ad" 
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content"
  app:backgroundColor="#000000"
  app:primaryTextColor="#FFFFFF"
  app:secondaryTextColor="#CCCCCC"
  android:layout_alignParentTop="true"
/>

<!-- WebView below that -->

<!--WebView-->

</RelativeLayout>
于 2012-07-05T08:37:26.597 回答