2013-06-08 1 views
1

내 LinearLayout 안에 두 번째 광고 배너를 추가하고 싶지만 두 번째 banner.Works를 RelativeLayout에 외부 배너와 함께 넣을 때 내 앱이 충돌하지만 두 번째 ... ScrollView 내부에 추가하려고합니다. 무엇을 할 수 있습니까? 내 코드는 다음과 같습니다.얼마나 많은 광고 배너를 android 레이아웃에 추가 할 수 있습니까?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#000000" > 

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
> 

      <TextView 

      /> 

      <ToggleButton 

      /> 

    <com.google.ads.AdView 
    android:id="@+id/adView" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 

    ads:adSize="BANNER" 
    ads:adUnitId="xxxxxxxx" 
    ads:loadAdOnCreate="true" 
    > 
</com.google.ads.AdView> 

</LinearLayout> 
    </ScrollView> 

<com.google.ads.AdView 
    android:id="@+id/adView" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    ads:adSize="BANNER" 
    ads:adUnitId="xxxxxxxxx" 
    ads:loadAdOnCreate="true" 
    > 
</com.google.ads.AdView> 

</RelativeLayout> 

답변

3

한 페이지에 여러 개의 Admob 광고보기를 표시하지 마십시오. 서비스 약관에 위배됩니다. AdMob에 가입하셨습니다. AdMob 계정을 일시 중지하지 않으려는 경우.

0

페이지에 무제한 광고를 추가 할 수 있습니다. 한계가 있다고 생각하지 않습니다. 그러나 권장하지는 않지만, admob 규칙에 따르면 한 페이지에 하나의 광고가 있어야합니다. 모든 Adview에서 선형 또는 상대적 일 수있는 별도의 레이아웃을 정의해야 할 수 있습니다. 당신이 당신의 텍스트 뷰ToggleButton을 레이아웃 매개 변수를 설정하지 않았기 때문에

응용 프로그램이 crahing된다. 제거하거나 레이아웃 속성을 설정하십시오. Like

  <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <ToggleButton 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 
+0

그래, 왜 LinearLayout 안에 배너를 삽입 할 때 충돌이 발생합니까? – user2342687

+0

사용중인 XML을 게시하십시오. 이 XML에서 기본 상대 레이아웃을 닫지 마십시오 – Rahul

+0

Ok.I my XML을 업데이트했습니다 ... 두 번째 xmlns : ads = "http : // ....? – user2342687

관련 문제