hons82 / THSegmentedPager

Simple plugin-sample using the HMSegmentedControl and a UIPageViewController to show Tabs
Other
219 stars 52 forks source link

changed viewWillAppear to setSelectedPageIndex with animated marked to YES #3

Closed noelrocha closed 10 years ago

noelrocha commented 10 years ago

I've changed viewWillAppear to setSelectedPageIndex with animated marked to YES. It was causing some issues with navigation controller. I also changed PageViewController to public to enable some UI customizations on children classes.

hons82 commented 10 years ago

What means "some issues" in this case?

noelrocha commented 10 years ago

After you popViewcontroller back to the segmented controller, there is a blank space between the segmented view and the container view.

Noel Rocha

Em 23/10/2014, às 05:03, Hannes notifications@github.com escreveu:

What means "some issues" in this case?

— Reply to this email directly or view it on GitHub.

hons82 commented 10 years ago

In my sample project I have kind of that situation... but without any error. But I guess your paged content is prefixed by a new navigation controller !?

I'll take your pull, but I'd like to change it to this

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    if ([self.pages count]>0) {
        [self setSelectedPageIndex:[self.pageControl selectedSegmentIndex] animated:animated];
    }
    [self updateTitleLabels];
}

maybe that's a more general approach du the problem.

You could actually add a second storyboard to this project and show me where the problem is because I can't really reproduce it in this way.