как реализовать 2 разных объявления, чтобы они появлялись внизу - PullRequest
0 голосов
/ 29 февраля 2012

Я использую тысячелетние СМИ и обожаю рекламу.У меня есть проблема в том, как реализовать их обоих.Я хочу, чтобы объявления отображались внизу приложения.

Я использую что-то подобное для относительного макета:

<RelativeLayout ...
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
     >
<com.millennialmedia.android.MMAdView
      android:id="@+id/mmadview1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"
      ... 
      app:adType="MMBannerAdBottom"
      app:height="60"
      app:width="480" />

<com.google.ads.AdView android:id="@+id/adView1"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adSize="BANNER"  
                         ...
                         ...
                          ..
                          android:layout_alignParentBottom="true"     />

  <TextView..../>

  <Button.../>

Кроме того, у меня есть несколько xmls с линейным макетом:

 <LinearLayout ...
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"  
 >
<com.millennialmedia.android.MMAdView
  android:id="@+id/mmadview5" 
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content"
   ... 
 ...
   app:adType="MMBannerAdBottom"
   app:height="60"
   app:width="480" />

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

 <RelativeLayout 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content" >


  <TextView  android:id="@+id/text1"
      android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true" />

 <EditText
    android:layout_width="180dip"
    android:layout_height="wrap_content"
android:id="@+id/num_cores"
android:layout_below="@+id/text1"
    />

   <Spinner 
    android:id="@+id/spinner"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true"  
    android:layout_marginTop="20dip" /> 

    <TextView
    android:id="@+id/core_search"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:linksClickable="true"
    android:layout_toRightOf="@id/num_cores"
    android:layout_marginLeft="45dip"
   />

 </RelativeLayout>
  <TextView
    android:id="@+id/text3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />

  <EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
android:id="@+id/halftimecores"

    />

   <TextView
    android:id="@+id/text4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
   />

  <EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
android:id="@+id/timecores"
    />

  <Button
    android:id="@+id/core_calcs"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    />

  </LinearLayout>

Я просто хочу, чтобы реклама показывалась внизу. Как я могу это сделать?(Сейчас они либо появляются сверху, либо не появляются)

1 Ответ

0 голосов
/ 29 февраля 2012

Если вы используете LinearLayout, поместите их после кнопки (@ + id / core_calcs), если вы используете RelativeLayout, используйте android: layout_below = "@ + id / core_calcs" для первого добавления и android: layout_below = "@ + id / firstAdd_ID" длявторое добавление

...