0

我想實現這樣的東西:http://android-developers.blogspot.in/2011/08/horizontal-view-swiping-with-viewpager.html。 ?
我的主要觀點是Viewflipper與cards.How的相反側的兩個觀點,我可以實現上面一個viewflipper佈局的viewpager我的佈局,現在是這樣的:viewpager中的ViewFlipper

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout android:id="@id/FlashCardFront" android:background="#3500ffff style="@style/Fill" 
xmlns:android="http://schemas.android.com/apk/res/android"> 
<ViewFlipper android:id="@+id/flipper" style="@style/Fill" android:layout_margin="8.0dip">  
<LinearLayout android:id="@+id/front" android:orientation="vertical" android:background="#ffffffff" style="@style/Fill"> 
    <LinearLayout style="@style/FillWrap.LL.FlashCard_Header"> 

     <ImageButton 
android:id="@+id/back" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:onClick="true" 
android:src="@drawable/left_arrow" 
android:background="#00000000" 
/> 

     <TextView android:id="@id/TV_CardNo" android:text="0000" android:layout_weight="1.0" style="@style/Wrap.Text_RightTop" /> 

     <ImageButton 
      android:id="@+id/next" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.14" 
      android:background="#00000000" 
      android:onClick="true" 
      android:src="@drawable/right_arrow" /> 

     </LinearLayout> 

     <LinearLayout android:id="@id/LL_Card" style="@style/FillWrap.LL.FlashCard_Body"> 
     <TextView android:id="@id/TV_Word" android:text="Word" style="@style/FillWrap.Text_FlashCard_Word" /> 
     </LinearLayout> 

     <LinearLayout style="@style/FillWrap.LL.FlashCard_Footer"> 
     <RatingBar android:id="@id/RB_Stars_Front" android:progressDrawable="@drawable/ratings_bar" android:numStars="1" android:stepSize="1.0" style="@style/Wrap" /> 
    </LinearLayout> 
</LinearLayout> 
<LinearLayout android:orientation="vertical" android:background="#ffffffff" style="@style/Fill"> 

    <LinearLayout android:id="@id/RearHeader" style="@style/FillWrap.LL.FlashCard_Header"> 
      <ImageButton 
android:id="@+id/rear_back" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:onClick="true" 
android:src="@drawable/left_arrow" 
android:background="#00000000" 
/> 
     <TextView android:id="@id/TV_CardNo" android:text="0000" android:layout_weight="1.0" style="@style/Wrap.Text_RightTop" /> 
     <ImageButton 
      android:id="@+id/rear_next" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.14" 
      android:background="#00000000" 
      android:onClick="true" 
      android:src="@drawable/right_arrow" />  
    </LinearLayout> 
    <LinearLayout android:id="@id/LL_Card1" style="@style/FillWrap.LL.FlashCard_Body"> 
    <ImageView android:id="@+id/image" android:layout_width="fill_parent" android:layout_height="fill_parent"></ImageView>  </LinearLayout> 
    <LinearLayout style="@style/FillWrap.LL.FlashCard_Footer"> 
       <TextView android:id="@id/TV_Meaning" android:text="Meaning" style="@style/FillWrap.Text_FlashCard_Meaning" /> 
    </LinearLayout> 
</LinearLayout> 
</ViewFlipper> 

+0

你試過了什麼?你是否在該頁面上一直沿用?如果將ViewPager添加爲佈局中的頂級父視圖,會發生什麼情況? – FoamyGuy

+0

@Tim我失去了我的佈局,如果我使ViewPlipper的ViewPager頂部。 – Maxsteel

回答

0

的風格,是有在頁面上使用名爲viewpagerindicator的庫完成...由傑克沃頓完成....檢查它是如何工作的