回答

0

好的,你需要使用的是一個ViewPager這將顯示你的內容作爲頁面你想要的視圖,它會讓你在它們之間滑動。

Here是一個簡單的入門指南。希望這有幫助

+0

謝謝you.But我一直在尋找光標和viewpager一個政黨成員,因爲正如我說,我有數據。 – Hanane

0

你可以將你的CursorAdapter包裝在PagerAdapter中以獲得兩者的功能。它應該是這個樣子,雖然我沒有這個代碼密切測試:

public class CursorPagerAdapter extends PagerAdapter { 
    private CursorAdapter mCursorAdapter; 

    public CursorPagerAdapter(CursorAdapter cursorAdapter) { 
     mCursorAdapter = cursorAdapter; 
    } 

    @Override 
    public int getCount() { 
     return mCursorAdapter.getCount(); 
    } 

    @Override 
    public boolean isViewFromObject(View view, Object object) { 
     return view == object; 
    } 

    @Override 
    public Object instantiateItem(ViewGroup container, int position) { 
     View view = mCursorAdapter.getView(position, null, container); 
     mCursorAdapter.getCursor().moveToPosition(position); 
     mCursorAdapter.bindView(view, container.getContext(), mCursorAdapter.getCursor()); 
     return view; 
    } 

    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) { 
     container.removeView((View)object); 
    } 

}