Если вы не сделаете то, что я сделал и жестко запрограммировал, его высота составляет около 50 dp. Не очень элегантно, но все же эффективно.

о, действительно странная ситуация с AdMob. Я хочу разместить объявление внизу у меня есть LinearLayout. Когда я делаю это никогда не появляется. Когда я помещаю это сверху, это обнаруживается отлично. Не уверен, в чем дело, вот мой код. Я получаю предупреждение в LogCat, которое гласит: «Недостаточно места для показа рекламы! Хочет <480,75> Имеет: <480, 0>»

LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/mypackage"
 android:id="@+id/mainmenulayout"
 android:orientation="vertical" 
 android:layout_width="fill_parent"
 android:layout_height="fill_parent">

    <ImageView  android:id="@+id/headerpic"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/header"/>

    <ListView android:id="@android:id/list" 
    android:divider="#00000000" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:drawSelectorOnTop="false"
    android:background="@android:color/transparent"
    android:cacheColorHint="#00000000"
    android:layout_alignParentTop="true">
    </ListView>

    <com.google.ads.AdView 
      android:id="@+id/adView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      ads:adUnitId="myadunit"
      ads:adSize="BANNER"
    />
 </LinearLayout>

и мой onCreate ():

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.appmenu);

    // Look up the AdView as a resource and load a request.
    AdView adView = (AdView)this.findViewById(R.id.adView);
    adView.loadAd(new AdRequest());

    String[] mainMenuList = getResources().getStringArray(R.array.mainMenuList);
    TypedArray[] picFiles = getResources().obtainTypedArray(R.array.arrayIcon);

    setListAdapter(new MyIconAdapter(mainMenuList, picFiles));

    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

}  //close onCreate

Ответы на вопрос(2)

Ваш ответ на вопрос