views:

1472

answers:

1

I have a Tab Bar Application with Navigation Controllers on each Tab Item. I want to add a floating (semi transparent view) on my Table View just above my Tab Bar. How can i achieve the results?

The results will be similar to how the Alpha list is displayed on the right of Contact Application's main view. I hope i'm clear in explaining what i want to do.

Any idea? Thanks.

+1  A: 

If all you want to do is display the floating alphabetical (or numerical) index above your table view, you just need to define two methods in your UITableViewDataSource:

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index

These provide the A-Z (or whatever) list of section titles for your index, and where in the table view each section starts.

For a more custom view, you should be able to create a view, set its background to [UIColor clearColor], lay out its contents, and add it as either a subview to the table view or as a subview above the table view in a view that encloses both.

Brad Larson
Don't forget you always have a view that encloses everything, with the UIWindow you add your initial View to - you can get at it from [UIApplication SharedApplication] with the keyWindow property.
Kendall Helmstetter Gelner
True, but it sounds like he doesn't want this overlay to spill over onto the tab bar, so he'd probably need to have a separate view that encloses the table and overlay, yet could be switched to by the tab bar.
Brad Larson