0
我無法正確發佈admob在帶有頂部的Progressbar的LinearLayout中的webview。我嘗試了很多方法,使用Relatives,並在Stackoverflow中搜索並執行一些步驟,但此Progressbar將無法工作。Webview + admob在底部+ LinearLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/ProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="false"
android:maxHeight="10dip"
android:minHeight="10dip"
android:progress="50"
android:progressDrawable="@drawable/greenprogress" />
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-7041222655570180/1503313077"
ads:loadAdOnCreate="true"
ads:refreshInterval="30" >
</com.google.ads.AdView>
</LinearLayout>
非常感謝你Tenfour,它的工作! :-) – David
就像我的魅力一樣。我敬禮。 –
我對使用Fragments展示廣告有疑問。 ([link](https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start))。如果沒有互聯網連接,內容是否會延伸並填滿屏幕? – user2731584