2017-12-30 24 views
0

안녕하세요. 새해 복 많이 받으세요!광고 높이를위한 공간 높이기

내 활동에서 배너 광고 높이에 이상한 문제가 있습니다.

기본적으로 광고 크기는 320x50dp이지만 logcat에서는 320x0dp 만 볼 수 있습니다.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:ads="http://schemas.android.com/apk/res-auto". 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
tools:context=".MainActivity" 
tools:showIn="@layout/activity_main"> 

<LinearLayout 
    android:id="@+id/aboutLinearLayout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:layout_gravity="center_horizontal" 
    android:weightSum="1"> 


    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="400dp" 
     android:layout_height="200dp" 
     android:layout_gravity="center_horizontal" 
     android:contentDescription="Header picture" 
     android:importantForAccessibility="no" 
     android:maxHeight="57dp" 
     android:maxWidth="57dp" 
     android:src="@drawable/xm" 
     android:layout_marginBottom="15dp"/> 
    </LinearLayout> 

    <ScrollView 
     android:id="@+id/scrollView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:layout_below="@id/aboutLinearLayout"> 

     <LinearLayout 
      android:id="@+id/aboutLinearLayout2" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:layout_gravity="center_horizontal" 
      android:weightSum="1"> 

    // some Switches and textviews here that i can't show you 


</LinearLayout> 

</ScrollView> 

// Using this form to show ads becouse i don't want that it overrides scrollview when it's shown 

<LinearLayout 
    android:id="@+id/layoutadmob" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_centerVertical="true" 
    android:layout_below="@id/scrollView"> 

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

</LinearLayout></RelativeLayout> 

어느 하나 내가 충분히 확보 할 수 있습니다 방법을 알고 : 이 분명히

내 contant_main가 여기에있다 ... 거기에 충분한 공간이 광고의 높이를로드 아니지만 내가 해결하는 방법을 알고하지 않는 것을 의미한다 내 레이아웃을 보여주는 앱 레이아웃 공간?

감사

답변

0

하단에있는 LinearLayout 잘되는있는 ScrollView 아래이지만,있는 ScrollView 높이가 아래 페이지에서 모든 길을 만드는 'wrap_content'입니다. 속성 추가

android:layout_alignParentBottom 

true로 설정하십시오.

+0

scrollview 안에? – androidexpert35