Skip to content

Using a UISegmentedControl in a UINavigationBar to switch between table view controllers that refresh.

Notifications You must be signed in to change notification settings

alextrob/SegmentedContainerDemo

Repository files navigation

SegmentedContainerDemo

Screenshot showing portrait, refreshing Screenshot showing landscape, refreshing

This is a sample/demo for using a UISegmentedControl in a UINavigationBar to switch between child UITableViewControllers that have UIRefreshControls enabled, while still allowing content to blur behind the navigation bar in iOS 7. It's iOS 7-only, so you'd probably want to add some conditions to support older versions.

The problem I was running into was that the first view controller would display perfectly fine, with the top of the first cell sitting right at the bottom of the navigation bar. Subsequent child view controllers would have the first cell displaying up underneath the statusbar.

It appears that the automaticallyAdjustsScrollViewInsets property works on the first child view controller, but not subsequent view controllers.

The closest answer I could find is here on StackOverflow, but rotation and refresh didn't quite work.

About

Using a UISegmentedControl in a UINavigationBar to switch between table view controllers that refresh.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published