gpt4 book ai didi

android - viewpager 中的 ViewFlipper

转载 作者:行者123 更新时间:2023-11-30 04:13:19 26 4
gpt4 key购买 nike

我想实现这样的东西:http://android-developers.blogspot.in/2011/08/horizontal-view-swiping-with-viewpager.html .
我的主视图是一个 Viewflipper,在卡片的相对两侧有两个 View 。我如何在 viewflipper 布局之上实现一个 viewpager?我现在的布局是这样的:

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

最佳答案

页面上的样式是使用名为 viewpagerindicator 的库完成的...由 Jake wharton 完成...检查其工作原理

关于android - viewpager 中的 ViewFlipper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10472072/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com