My split view controller is not showing a toolbar. How do I remove the toolbar shine effect from the background in the table view?

StackOverflow https://stackoverflow.com/questions/11398703

Domanda

I'm working on an App based on the Master-Detail Application template in Xcode 4.3.3. I'm noticing an odd artifact in the Master Table View popover in portrait mode. Here is a screen shot of the oddity. (I'm specifically referring to the shine affect in the area that could optionally contain a toolbar.)

http://www.appsbyallen.com/images/stackoverflow/Menu.png

Here are the steps to reproduce this issue.

1) Create a new Project based on Master-Detail Application.

2) Open the iPad storyboard and change the Table View style from Plain to Grouped.

3) In MasterViewController's viewDidLoad, add either "self.tableView.backgroundView.alpha = 0.0" or "self.tableView.backgroundView = nil". I've tried both.

4) Run the App in the iPad simulator in portrait mode. Click the Master button. Observe the oddity.

My intent is to allow the Detail View Controller to show through the popover.

Is this a bug in Apple's code? Or am I doing something wrong here? The test case is seemingly so simple.

Thank you.

È stato utile?

Soluzione

I've identified a way to work around this issue.

In MasterViewController's viewDidLoad, show the toolbar with

  • self.navigationController.toolbarHidden = NO;

Then in MasterViewController's viewWillAppear, hide it again with

  • self.navigationController.toolbarHidden = YES;

And, then show it again in MasterViewController's viewDidDisappear with

  • self.navigationController.toolbarHidden = NO;

All three cases are required. The shine effect seems to be generated only in the case that the toolbar is hidden while the view is not being displayed.

I hope this helps someone else!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top