我有3個線性佈局,圖像視圖的第一個佈局,兩個按鈕的第二個佈局,即下一個,上一個和第三個我爲admob添加,但問題是我的addmob(廣告)需要額外的廣告空間,但我想顯示頂部OR圖像的底部位置,我如何設置它的XML?如何添加ad-mob(廣告橫幅)Imageview的頂部或底部?
檢查這個環節,我希望我的廣告條幅這個樣子的圖像,不採取額外的空間: http://2.bp.blogspot.com/-JhSeZI0Wy1w/TuAW-6bEtNI/AAAAAAAAAEA/SsVGJXJhQ2s/s1600/AdsOutsideScrollView.png
我的XML:
< XML版本= 「1.0」 編碼=「UTF- 8" ? >
<的LinearLayout
的xmlns:機器人= 「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:background="#000000"
android:gravity="fill"
android:orientation="vertical"
android:weightSum="100">
<ImageView
android:id="@+id/idImageViewPic"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="100"
android:adjustViewBounds="true"
android:background="#000000"
android:maxHeight="91dip"
android:maxWidth="47dip"
android:padding="10dip"
android:src="@drawable/p1"
/>
<LinearLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="50dp"
>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="aasdf74546adsf"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
>
</com.google.ads.AdView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
>
<Button
android:id="@+id/bGeri"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#d6d6d6"
android:text="Previous"
android:textStyle="bold" >
</Button>
<Button
android:id="@+id/bIleri"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#d6d6d6"
android:text="Next"
android:textStyle="bold" >
</Button>
</LinearLayout>
使用的FrameLayout –
@AM:我不希望像點擊改變,我只是想表明添加的旗幟頂部或圖像的底部。 – Adnan
也根據你的評論當我改變我的根佈局(LinearLayout)FrameLayout然後我的圖像不會顯示? – Adnan