2015-01-08 3 views
0

내 앱 레이아웃이 많습니다. 작은 레이아웃을 제외하고는 광고가 잘 작동하며 문제의 원인을 알 수 없습니다. 모든 레이아웃 폴더에서 레이아웃 파일과 조각 (각 화면 크기에 대해)을 만들었습니다. 장치 (크고 대형 화면)에서 응용 프로그램을 실행하면 제대로 작동합니다. 그러나 작은 화면 장치를 사용할 때는 그렇지 않습니다.작은 레이아웃의 광고가 표시되지 않습니다.

레이아웃 XML 파일 :

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    tools:context=".java0" 
    tools:ignore="MergeRootFrame" 
    android:screenOrientation="portrait" 
    android:icon="@drawable/ic_launcher" 
    android:background="#ffff7e00"> 

    <!----> 
    <fragment 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:name="nadsat.aplicacion.safrapp.lajerganadsat.java0$PlaceholderFragment" 
     tools:layout="@layout/fragment_ad" 
     android:id="@+id/fragment" 
     android:layout_alignBottom="@+id/adFragment" /> 
    <fragment 
     android:name="nadsat.aplicacion.safrapp.lajerganadsat.java0$AdFragment" 
     android:id="@+id/adFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     tools:layout="@layout/fragment_ad" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" /> 

    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="@string/duda" 
     android:background="#ff000000" 
     android:textColor="#ffffffff" 
     android:id="@+id/bDuda" 
     android:textSize="35sp" 
     android:layout_above="@+id/bOtras" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="10dp" 
     android:clickable="true" /> 
    <Button 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:textSize="24sp" 
     android:textColor="#ff000000" 
     android:background="#ffffffff" 
     android:textStyle="bold" 
     android:clickable="true" 
     android:text="Otras aplicaciones" 
     android:id="@+id/bOtras" 
     android:layout_above="@+id/bLista" 
     android:layout_alignLeft="@+id/bLista" 
     android:layout_alignStart="@+id/bLista" 
     android:layout_marginBottom="10dp" /> 

    <Button 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:textSize="24sp" 
     android:textColor="#ff000000" 
     android:background="#ffffffff" 
     android:textStyle="bold" 
     android:clickable="true" 
     android:text="@string/bLista" 
     android:id="@+id/bLista" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" /> 



</RelativeLayout> 

단편 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/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <com.google.android.gms.ads.AdView 
     android:id="@+id/adView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     ads:adSize="BANNER" 
     ads:adUnitId="@string/banner_ad_unit_id"> 
    </com.google.android.gms.ads.AdView> 

</RelativeLayout> 

답변

0

그것을 바깥 라에서 RelativeLayout의 왼쪽/오른쪽 패딩을 설정했기 때문에 거의 확실합니다. yout 파일.

logcat을 확인하십시오. 크기가 충분하지 않아 광고를 게재 할 수없는 경우 알려줍니다.

+0

오류 메시지가 없습니다 ... –

+0

귀하의 logcat에 * 분명히 * AdMob 관련 로그가 있습니다. 그것을 게시하십시오. – William

+0

업데이트를 확인하십시오. –

관련 문제