¡@

Home 

2014/10/16 ¤W¤È 08:21:08

android Programming Glossary: pageindex

dynamically add and remove view to viewpager

http://stackoverflow.com/questions/13664155/dynamically-add-and-remove-view-to-viewpager

v0 0 Here's what the app should do to add a view to the ViewPager. public void addView View newPage int pageIndex pagerAdapter.addView newPage You might want to make newPage the currently displayed page pager.setCurrentItem pageIndex.. pagerAdapter.addView newPage You might want to make newPage the currently displayed page pager.setCurrentItem pageIndex true Here's what the app should do to remove a view from the ViewPager. public void removeView View defunctPage int.. Here's what the app should do to remove a view from the ViewPager. public void removeView View defunctPage int pageIndex pagerAdapter.removeView pager defunctPage You might want to choose what page to display if the current page was defunctPage..