Does someone know how to use PagerTitleStrip in Android

前端 未结 3 1318
我在风中等你
我在风中等你 2021-02-04 01:33

I decided to use a ViewPager in my application and everything is working fine. I Know that I want to use a PagerTitleStrip in my ViewPager

3条回答
  •  执念已碎
    2021-02-04 02:12

    I'm not sure what causing error in your case but this is how I use it, in your layout you should insert following code in your layout:

    
    
            
    
    

    Then you should add the following code in your PageAdapter:

            @Override
            public CharSequence getPageTitle (int position) {
                return "Your static title";
            }
    

    That's pretty it.

提交回复
热议问题