If your adapter doesn't implement the interface CustomTabProvider the default tab will be used, which is a TextView with id R.id.psts_tab_title). The interface provide callbacks for selection and unselection of tabs as well. If you don't want the library manage your TextView title for the tab, use a different id than R.id.psts_tab_title in your tab layout. Will be used to placed the title and set the view state (pressed/selected/default). In case the the view returned contains the id R.id.psts_tab_title, this view should be a TextView and If your adapter implements the interface CustomTabProvider you can paste your custom tab view/s. setViewPager( pager) That's all you need to do, but if you want to use your own tabs, then. Bind the tabs to the ViewPager PagerSlidingTabStrip tabs = ( PagerSlidingTabStrip) findViewById( R. setAdapter( new TestAdapter( getSupportFragmentManager())) Initialize the ViewPager and set an adapter ViewPager pager = ( ViewPager) findViewById( R.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |