views:

158

answers:

1

I am trying to create a application with a tab bar and a common WebView.

The different tabs shows/hides different divs in the WebView but maintain the state otherwise, so I need to share the web view between the tabs.

I am trying to use a nib, but I think that might not be the right solution here.

Any pointers for doing this correctly?

+1  A: 

You don't need a UITabBarController, a UITabBar would suffice. You only need to assign it a delegate, and implement the tabBar:didSelectItem: delegate method.

Here's what I would do:

  1. Create a view controller and add a UITabBar and a UIWebView
  2. Set UITabBar's delegate to this view controller and implement tabBar:didSelectItem:
  3. Show/hide divs as necessary in tabBar:didSelectItem:
Can Berk Güder
Thanks. Pretty simple.
You're welcome. Please don't forget to mark my answer as accepted.
Can Berk Güder