2011-04-24 6 views
0

Je suis en train de construire une activité structurée comme suit:Android: ScrollView + ViewFlipper + Bar Bas

  • TopBar
  • ScrollView
  • > ViewFlipper
  • Bottom Bar

Qu'est-ce que J'ai fait est:

<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> 

Cela, bien sûr, ne fonctionne pas. En fait, il semble que la barre inférieure soit cachée sous viewflipper. Comment puis-je résoudre ce problème?

+0

La disposition extérieure est une disposition linéaire. Mettre la BARRE INFERIEURE sous ScrollView ne fonctionne pas non plus. – Stefano

Répondre

0

Je vais essayer d'y parvenir de la manière suivante:

<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

Vous pouvez utiliser weigths pour cela. Essayez ceci:

<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> 

qui donnera un espace égal à la ViewFlipper et le second LinearLayout.