ViewPager Title doesn't appear until I swipe it

后端 未结 4 1594
名媛妹妹
名媛妹妹 2021-01-11 12:41

I am learning to use ViewPager and PagerTabStrip to implement navigation bar. I have implemented it, my problem is: every time I open the app fresh, the titles don\'t show,

4条回答
  •  别那么骄傲
    2021-01-11 13:32

    It is an issue appeared in com.android.support:appcompat-v7:23.0.0. You can refer here https://code.google.com/p/android/issues/detail?id=183127

    In that link google support team have mention that defect would be fixed in future releases. So for now solution is build the project using com.android.support:appcompat-v7:22.2.1

    Update : If feasible for you then you can go ahead with another solution provided by @nidheeshdas. I have tried on simple project; it work Modified solution of @nidheeshdas inside onResume() of Activity

    viewPager.setCurrentItem(1);
        viewPager.postDelayed(new Runnable() {
            @Override
            public void run() {
                viewPager.setCurrentItem(0);
            }
        },100);
    

    New Update: As mentioned in the above google issue tracker link and comments from JP Ventura. I have tried with new version of library and issue seems to be fixed.

提交回复
热议问题