Sam Brown
Sam Brown

Reputation: 41

"Best" Way to Implement a UISegmentedControl underneath a UINavigationBar

I am working on an app that uses a navigation controller to control the views. In one part of my app, I want to have a UIView with a UISegmentedControl just underneath the navigation that will "filter" the UITableView. Essentially:

========================================
| < Back)     Title Goes Here          |  <- navigation bar
========================================
|    ( All | Active | Inactive )       |  <- segmented control
========================================
|    Item one                        > |  <- UITableView all the way down
|--------------------------------------|
|    Item two                        > |
|--------------------------------------|
|    Item three                      > |
|--------------------------------------|
|    Item four                       > |
|--------------------------------------|
|    Item five                       > |
|--------------------------------------|
|    Item six                        > |
========================================

So how do I put this together; how would I do it in code or how would I do it in IB?

Thanks!

Upvotes: 4

Views: 596

Answers (2)

RickiG
RickiG

Reputation: 11390

The UITableView should have 2 sections, the segmentedControl in section one and the items in section 2.

Upvotes: 0

Dave DeLong
Dave DeLong

Reputation: 243146

That seems pretty close to the Scope bar of a UISearchBar. Have you considered using that?

Upvotes: 1

Related Questions