Question

I have a tab bar app but the first tab is an image with a button on it. Touching the button is supposed to push a web view. The other tabs are plain web views. Those work fine but every time I push to a new view, it's blank (except for the back button at the top.)

Questions:

Do I need an xib for the pushed web view?

Where does the loadRequest code go exactly? (I used awakeFromNib in the tab bar views)

When I hit the back button, is there a hook or some method I can add to to hide the top nav bar?

Was it helpful?

Solution

First, you never need a .xib for anything; you can always construct your views in code.

Second, what do you mean by "push a web view" and "push to a new view"? You are using a UINavigationController for that page, correct? So you are saying that initially the tab shows the correct page, but when you push a subview onto the stack it comes up blank?

I suspect the place you want loadRequest is in viewDidLoad, but I'd have to see what you are trying to do.

As for hiding the top navigation bar, are you looking for something like this:

self.navigationController.navigationBarHidden = YES;

If so, all you have to do is set that on the page for which you want the navigation bar to be hidden; it has nothing to do with the back button.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top