ScrollPager icon indicating copy to clipboard operation
ScrollPager copied to clipboard

setSelectedIndex, doesn't show entire 'selected' view

Open aramikg opened this issue 10 years ago • 5 comments

for example, I have 3 tabs. I set the selectedIndex to 1 (the middle one) on viewDidLoad and the scrollview only scrolls half way between 0 and 1...

This is being implemented using storyboards

aramikg avatar Aug 13 '15 04:08 aramikg

I think issues has to do with storyboard / auto layouts. quick hack/fix for this is adding:

scrollPager.scrollView?.frame.size.width = UIScreen.mainScreen().bounds.width

in ``viewDidLoad` right before

scrollPager.delegate = self
    scrollPager.addSegmentsWithTitlesAndViews([....

aramikg avatar Aug 13 '15 04:08 aramikg

Can you reproduce this in the sample project?

aryaxt avatar Aug 13 '15 18:08 aryaxt

Yes, in the sample project - same thing happens.

aramikg avatar Aug 13 '15 19:08 aramikg

Had the same problem, the quick fix works though. Weird.

enstulen avatar Oct 28 '16 05:10 enstulen

i have got same issue pls do update asap

maulik6994 avatar Jul 11 '17 14:07 maulik6994