viewFlipper 怎么设置只能左右滑动不能上下滑动

发布网友

我来回答

1个回答

热心网友

自己写个ViewFlipper 的继承的方法:public class ListFliper extends ViewFlipper { public static final int FIRST = 0; public static final int SECOND = 1; public static final int THREE = 2; public ListFliper(Context context){ super(context); } public ListFliper(Context context, AttributeSet attrs){ super(context, attrs); } public void showNextFromRight(){ setPersistentDrawingCache(ViewGroup.PERSISTENT_ALL_CACHES); setInAnimation(getContext(), R.anim.push_right_in); setOutAnimation(getContext(), R.anim.push_left_out); this.showNext(); } public void showPreFromLeft(){ setPersistentDrawingCache(ViewGroup.PERSISTENT_ALL_CACHES); setInAnimation(getContext(), R.anim.push_left_in); setOutAnimation(getContext(), R.anim.push_right_out); this.showPrevious(); }}

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com