2013-10-01 2 views
-1

레이아웃보기 속성을 사용하여 스크롤보기를 구현하고 싶습니다. 사실 나는 전체 화면에 내 활동 내용을 표시하고 싶다면 사용자가 아래로 스크롤하면 광고를 볼 수 있습니다. 어떻게하면이 일을 말해 줄 수 있습니다.레이아웃 가중치 태그로 스크롤보기

답변

1

다음은 당신의있는 ScrollView 안쪽에 당신에게 광고 배너를 추가해야이 있다면 당신은 ... 알 수 있습니까에 대해 다음과 레이아웃이 작동합니다 생각합니다. .. 그와 같은 것 :

<ScrollView 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 

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

    <LinearLayout android:id="@+id/content" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     > 

    </LinearLayout> 

    <com.ads.adsbanner 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/myAdBaner"/> 

</LinearLayout> 

</ScrollView> 

콘텐츠를 "콘텐츠"에 추가하기 만하면됩니다.

0

나는 완전히 질문을 이해하지 않았다 그러나 나는 당신이 어떤 확률값

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

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

      <!-- MAIN CONTENT --> 
     </LinearLayout> 
    </ScrollView> 

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

     <!-- ADS --> 
    </LinearLayout> 

</LinearLayout> 
+0

실제처럼 전체 화면으로 내 콘텐츠를 표시하고 싶지만 화면 맨 아래 또는 화면 하단에 표시하려는 광고가 있고 그 광고를 볼 수 있습니다. 활동 시작 광고는 화면에 표시되지 않지만 언제 표시됩니까? 사용자가 아래로 스크롤하여 광고 –

+0

을 표시 한 다음 Cehm의 대답을 살펴보십시오. – Rehan