利用無限循環效果的話,很像在設定鬧鐘時間, 00分往上滾是01分,往下滾59分
很有趣的,這個方法不是對ListView下手,而是對Adapter著手
public class CircularArrayAdapter extends ArrayAdapter { public static final int HALF_MAX_VALUE = Integer.MAX_VALUE/2; public final int MIDDLE; private T[] objects; public CircularArrayAdapter(Context context, int textViewResourceId, T[] objects) { super(context, textViewResourceId, objects); this.objects = objects; MIDDLE = HALF_MAX_VALUE - HALF_MAX_VALUE % objects.length; } @Override public int getCount() { //關鍵在這邊!!! 主要增加這個就可以讓整個ListView變超大 return Integer.MAX_VALUE; } @Override public T getItem(int position) { return objects[position % objects.length]; } }