Since self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
not working, I've found an easy and workable way to remove the shadow of UINavigationBar
in both iOS 6 AND iOS 5. Hope people who need can see this post.
All you have to do is prepare one background image that the height is 1 pixel larger than your navigation bar height (e.g. 320×45 for default UINavigationBar, 640×90 for 2x of course).
Then just use [[UINavigationBar appearance] setBackgroundImage: ...]
, you will find shadow is replaced by that 1 pixel. cheers!
BTW I found Twitter has done the exactly same thing, if you unzip Twitter.ipa
and look into bg_nav_bar_events_dark.png
, the size is 320×47. They made their own shadow for 3 pixels :)