Since self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init]; doesn't work, I found a simple and workable way to remove the UINavigationBar shadow in both iOS 6 and iOS 5. I hope that people who need can see this post.
All you have to do is prepare a single background image so that the height is 1 pixel larger than the height of your navigation bar (for example, 320 × 45 for the UINavigationBar by default, 640 × 90 for 2x, of course).
Then just use [[UINavigationBar appearance] setBackgroundImage: ...] , you will find that the shadow is replaced by 1 pixel. Hurrah!
By the way, I found that Twitter did the same if you unzip Twitter.ipa and look at bg_nav_bar_events_dark.png , size 320 × 47. They created their own 3 pixel shadow :)
xiaobo Sep 13 '13 at 7:39 on 2013-09-13 07:39
source share