2011-04-24 15 views
0

나는 다음과 같은 구조 활동을 구축을 위해 노력하고있다 :안드로이드 :있는 ScrollView + ViewFlipper + 하단 바

  • TopBar
  • 있는 ScrollView를
  • > ViewFlipper
  • 하단 바

무엇 내가 한 것은 :

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

    <LinearLayout style="@style/TitleBar"> 
     TOP BAR 
    </LinearLayout> 

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

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

      <ViewFlipper android:id="@+id/details" 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent"> 

       VIEW FLIPPER 

      </ViewFlipper> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:padding="10dp" 
       android:background="@android:drawable/bottom_bar" 
       android:gravity="center_vertical"> 

       BOTTOM BAR 

      </LinearLayout> 
     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 

물론 이것은 작동하지 않습니다.

실제로 하단 바는 viewflipper 아래에 숨겨져있는 것 같습니다. 어떻게 해결할 수 있습니까?

+0

외부 레이아웃은 선형 레이아웃입니다. 아래쪽 막대를 ScrollView 아래에두면 작동하지 않습니다. – Stefano

답변

0
나는 다음과 같은 방법으로이를 달성하기 위해 노력하겠다고

:

<LinearLayout style="@style/TitleBar"> 
    TOP BAR 
</LinearLayout> 

<ScrollView android:layout_width="fill_parent" 
      android:layout_height="0dip" 
      android:layout_weight="1" 
      android:fillViewport="true" > 

    <ViewFlipper android:id="@+id/details" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"> 

     VIEW FLIPPER 

    </ViewFlipper> 
</ScrollView> 

<LinearLayout android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:padding="10dp" 
       android:background="@android:drawable/bottom_bar" 
       android:gravity="center_vertical"> 

    BOTTOM BAR 

</LinearLayout> 
0

이에 대한 weigths를 사용할 수 있습니다. 이 시도 :

<ViewFlipper android:id="@+id/details" 
         android:layout_width="fill_parent" 
         android:layout_height="0dp" 
         android:layout_weight="1"> 

       VIEW FLIPPER 

      </ViewFlipper> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="0dp" 
       android:layout_weight="1" 
       android:padding="10dp" 
       android:background="@android:drawable/bottom_bar" 
       android:gravity="center_vertical"> 

       BOTTOM BAR 

      </LinearLayout> 

ViewFlipper 두 번째 LinearLayout에 동일한 공간을 줄 것이다.