Closed Shusshu closed 11 years ago
yes but it didn't switch the proper tab selection....
Benoit Billington
On Wed, Jul 10, 2013 at 10:17 PM, Andreas Stütz notifications@github.comwrote:
http://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem(int)
— Reply to this email directly or view it on GitHubhttps://github.com/astuetz/PagerSlidingTabStrip/issues/27#issuecomment-20769972 .
pager = (ViewPager) findViewById(R.id.pager);
pagerStrip = (PagerSlidingTabStrip) findViewById(R.id.pager_tab_strip);
pagerAdapter = new MyPagerAdapter(this, getSupportFragmentManager());
pager.setAdapter(pagerAdapter);
pagerStrip.setViewPager(pager);
pager.setCurrentItem(3);
works for me.
It was a problem somewhere else ;) thx
I am facing issue when i add following extra lines to above code. final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources().getDisplayMetrics()); mPager.setPageMargin(pageMargin);
ViewPager shows correct tab but pagerStrip show next tab selected.
@shakmak I'm seeing the same problem too. Does the sequence of these settings affect it? Have u overcome this?
@hongzhou85 I tried changing sequence but that didn't help. So i had to remove pageMargin to make it work. So issue is when you set some PageMargin
Hi! @astuetz nice example and its become too much usefull for me. I have faced problem that is tabstrip not scroll when i set current item in view pager, tab get selected properly but it does not scrolls to visible area.
how to load view only when specific tab is focused
Ability to set the current tab.
For example I would like to directly see the middle tab