发布网友
共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(); }}