PDA

View Full Version : UINavigationItem redrawing problem




BNicholson
Jun 17, 2008, 12:28 PM
Hey guys, I have been fighting with my UIViewController's navigationItem to get it to redraw the title after I have hidden the back button. In previous beta's(I think 5 was the last one) when I called this:

[self.navigationItem setHidesBackButton:YES animated:YES];

the title automatically adjusted itself to be center since there was no longer a back button taking up space on the title bar. I was wondering if anyone had come across this issue or if anyone knows of a way to get the title to center itself after I hide the back button.

-Brent



Eraserhead
Jun 17, 2008, 12:31 PM
Try calling the display method.

BNicholson
Jun 17, 2008, 01:00 PM
Try calling the display method.

Could you be a little more specific? I have tried calling "setNeedsDisplay" on the entire view, and that didn't work. Because a UINavigationItem doesn't have a "display" method.

-Brent

Eraserhead
Jun 17, 2008, 01:20 PM
Sorry for being unclear :o.

UINavigationItem doesn't inherit from NSView, but UINavigationBar does so try calling display on that...

BNicholson
Jun 17, 2008, 01:51 PM
Sorry for being unclear :o.

UINavigationItem doesn't inherit from NSView, but UINavigationBar does so try calling display on that...

Thank you very much Eraserhead, that worked perfectly! =) I really appreciate the help.

-Brent