2014-03-31 6 views
0

페이지 하단에 광고 배너를 표시하고 싶습니다. 실제로 목록은 전체 화면을 채 웁니다. 광고를 어떻게 게재합니까?페이지 하단에 배너를 설정하는 방법은 무엇입니까?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/LinearLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    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="de.foo.foo.MainActivity$PlaceholderFragment" > 

    <Fragment 
     android:id="@+id/list_fragment" 
     android:name="de.foo.foo.MyListFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

    <Fragment 
     android:id="@+id/ad_fragment" 
     android:name="de.foo.foo.AdFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 


</LinearLayout> 
+0

에 필요한 공간을 제외한 모든 공간을 채울 것입니다, 그것은 도움이 될 수 있습니다 : 에 http : // 유래를 .com/questions/5380383/overlay without-overlay without-overlay without-way-to-get-ad-to-show-overlay –

+0

어쩌면이 답변을 시도해 볼 수도 있습니다. 시나리오에서 프레임 레이아웃이 잘 작동 할 수 있습니다. http : // stackoverflow.com/questions/19129992/android-overlay-at-bottom- of-the-screen –

답변

1

사용 RelativeLayout 대신 LinearLayout :

여기 내 레이아웃입니다.

또는 여기에 다른 방법 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/LinearLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    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="de.foo.foo.MainActivity$PlaceholderFragment" > 

    <Fragment 
     android:id="@+id/ad_fragment" 
     android:name="de.foo.foo.AdFragment" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" />// here 

    <Fragment 
     android:id="@+id/list_fragment" 
     android:name="de.foo.foo.MyListFragment" 
     android:layout_width="match_parent" 
     android:layout_weight="1" // here 
     android:layout_height="0dp" /> // here 


</LinearLayout> 

list_fragment이 응답을 살펴 ad_fragment

+0

완벽하게 작동, 감사합니다 – gurehbgui

+0

당신은 오신 것을 환영합니다. – Divers

관련 문제