2012-11-14 4 views
0

내 admob 광고와 바로 아래에 다음 이미지 사이에 간격이 있습니다. 왜? 틈새는 광고와 거의 같은 높이입니다. 여기 내 XML은 다음과 같습니다 admob 광고 후에 왜 간격이 있습니까?

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="#ffffff" 
android:gravity="center_horizontal" 
android:orientation="vertical" > 

<LinearLayout 
    android:id="@+id/linearad" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="0.1" 
    android:orientation="horizontal" > 
</LinearLayout> 

<LinearLayout 
    android:id="@+id/companylogo" 
    android:layout_width="wrap_content" 
    android:layout_height="0dp" 
    android:layout_weight="0.2" 
    android:background="@drawable/hotluxa" 
    android:orientation="horizontal" > 

    <ImageButton 
     android:id="@+id/kisstabutton" 
     android:layout_width="wrap_content" 
     android:layout_height="0dp" 
     android:src="@drawable/clear" /> 
</LinearLayout> 

<LinearLayout 
    android:id="@+id/vehicletype" 
    android:layout_width="wrap_content" 
    android:layout_height="0dp" 
    android:layout_weight="0.5" 
    android:orientation="vertical" > 

    <ImageButton 
     android:id="@+id/imageButton1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/corvetteconvertible" 
     android:src="@drawable/clear" /> 
</LinearLayout> 

<LinearLayout 
    android:id="@+id/soundoptions" 
    android:layout_width="wrap_content" 
    android:layout_height="0dp" 
    android:layout_weight="0.12" 
    android:orientation="horizontal"> 

    <ImageButton 
     android:paddingTop="2dp" 
     android:paddingBottom="2dp" 
     android:id="@+id/imageButton4" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/greenbubble" 
     android:src="@drawable/clear" /> 
</LinearLayout> 

<ImageButton 
    android:id="@+id/imageButton6" 
    android:layout_width="wrap_content" 
    android:layout_height="0dp" 
    android:layout_weight="0.12" 
    android:background="@drawable/fullversion" 
    android:src="@drawable/clear" /> 



</LinearLayout> 

내 자바 파일 (추출물)에 대한

: super.onCreate (savedInstanceState); setContentView (R.layout.mainxml); Log.e ("main", "mainxml loaded ok");

// Create the adView 
    adView = new AdView(this, AdSize.BANNER, "a1509a21e11b5e1"); 

    // Lookup your LinearLayout assuming it's been given 
    // the attribute android:id="@+id/mainLayout" 
    LinearLayout layout = (LinearLayout) findViewById(R.id.linearad); 
    Log.e("main", "1"); 
    // Add the adView to it 
    layout.addView(adView); 
    Log.e("main", "2"); 
    // Create an ad request. Check logcat output for the hashed device ID to 
    // get test ads on a physical device. 
    AdRequest adRequest = new AdRequest(); 
    adRequest.addTestDevice(AdRequest.TEST_EMULATOR); 

    Log.e("main", "3"); 

    // Initiate a generic request to load it with an ad - should be when finished: adView.loadAd(new AdRequest()); 
    adView.loadAd(adRequest); 
+0

전체 XML을 게시하십시오. –

+0

광고를 추가하는 코드를 게시 – jcw

+0

레이아웃 가중치와 관련이있을 수 있습니다. 'linearad' 컨테이너에 50dp 높이를 부여하십시오. –

답변

0

오래된 케이스를 정리하십시오. 나는 50dp 높이가 해결했다고 믿는다.