tags:

views:

23

answers:

1

Hi,

I want to have same segmented control across on all navigation tabs with segment value change delegate in it which refereshes currently selected tab data. . I dont want to create different sengemented control for each tab.

Please guide me. Thanks in advance.

Regards, Malleswar

A: 

You would need to make your UISegmentedControl a peer of the UITabBarController view. So it would look like this:

 -------------------
|UISegmentedControl |
|-------------------|
|                   |
|                   |
|                   |
|                   |
|                   |
|UITabBarController |
|                   |
|                   |
|                   |
|                   |
|                   |
 -------------------

The key here is that your UISegmentedControl needs to not be a subview of the UITabBarController view, so I would create a separate UIViewController subclass that owns and lays out the UISegmentedControl and UITabBarController views.

Also, I'd recommend embedding the UISegmentedControl in a UIToolBar. That will look a lot better than placing it on a blank view.

Alex