开发者

Android XML Layout Question Regarding Adding Admob Banner

I have been trying to add a Admob Ad into my XML layout, but for the life of me cannot get it to show up, Please could someone point out where i need to insert it and if i need to change the layout. This is driving me nuts.

Thanks in-advance

Lucy

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:background="@drawable/menu_background"
 android:layout_height="fill_parent"
 android:layout_width="fill_parent"
 android:paddingTop="15dip"
 android:paddingBottom="15dip"
 android:paddingLeft="30dip"
 android:paddingRight="30dip"
 android:orientation="horizontal">
 <LinearLayout
  android:orientation="vertical"
  开发者_如何学运维android:layout_height="wrap_content"
  android:layout_width="fill_parent"
  android:layout_gravity="center">

  <ImageButton 
     android:id="@+id/btnContinue"
     android:visibility="invisible"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/btn_continue"
     android:layout_gravity="left"
     android:layout_marginBottom="5dip"
  />
   <ImageButton 
     android:id="@+id/btnNewGame"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
      android:background="@drawable/btn_new_game"
      android:layout_gravity="left"
      android:layout_marginTop="50dip"
      android:layout_marginBottom="5dip"
  />
  <ImageButton 
     android:id="@+id/btnSetting"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/btn_settings"
     android:layout_gravity="left"
     android:layout_marginBottom="5dip"
  />
  <ImageButton 
     android:id="@+id/btnMoreApps"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/btn_more_apps"
     android:layout_gravity="left"
     android:layout_marginBottom="5dip"
  />
  <ImageButton 
     android:id="@+id/btnTutorial"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/btn_tutorial"
     android:layout_gravity="left"
     android:layout_marginBottom="5dip"
  />
  <ImageButton 
     android:id="@+id/btnHighScores"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/btn_high_scores"
     android:layout_gravity="left"/>
  </LinearLayout>
    <com.admob.android.ads.AdView
    android:id="@+id/ad"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
   />
  </LinearLayout>


Try putting the add in a FrameLayout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜