2013-02-26 6 views
0

모든 활동에 대해 상위 아래에 내 admob 광고를 넣으려고합니다. 그러나 일부 경우에이 오류를 보여줍니다.표시 할 공간이 충분하지 않습니다. Admob 광고 경고

W/Ads(13240): Not enough space to show ad! Wants: <240, 37>, Has: <240, 0> 

XML 코드는 다음과 같습니다

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
    android:id="@+id/linear_layout_adv_container" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" > 

    <com.google.ads.AdView 
     android:id="@+id/adView" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     ads:adSize="SMART_BANNER" 
     ads:adUnitId="a15xxxxxxa8088" 
     ads:loadAdOnCreate="true" 
     ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" /> 

</RelativeLayout> 

내가 놓친 거지 모르는 이유는 점점 :

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/white" 
    android:orientation="vertical" > 

    <LinearLayout 
     style="@style/padding_title" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/ic_title" > 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:gravity="center" 
      android:text="Tickets &amp; Cards" 
      android:textColor="@color/white" 
      android:textSize="18.0sp" 
      android:textStyle="bold" /> 
    </LinearLayout> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 
    <More items here> 
     </ScrollView> 

    <include layout="@layout/ad_container" /> 

</LinearLayout> 

그리고 ad_container.xml입니다 0 높이 대신에 필요한 높이. 누군가가 문제를 지적하기를 바랍니다. 감사합니다.

답변

0

외부 레이아웃의 높이가 match_parent입니다. 즉, 창 크기입니다. 모든 자녀는 높이가 각각 wrap_content이고 각 콘텐츠의 높이에 맞는 것을 의미합니다. 이전 하위 항목 (광고 단위가 마지막으로 모두 사용됨)의 콘텐츠 높이가 창 높이보다 높으면 광고 단위에 남은 공간이 없습니다.

+0

그래서 하단에 표시하려면 어떻게해야합니까? – user818455

+0

wrap_content의 insted 인 37 픽셀로 설정하십시오. – g00dy

관련 문제