How do I disable the navigation bar shadow in iOS 6 for navigation bars with custom background images?

前端 未结 13 1493
后悔当初
后悔当初 2020-12-12 17:10

It seems in iOS 6, a drop shadow is automatically added to the navigation bar even when you set a custom background image. I\'m pretty sure this wasn\'t the case with iOS 5

13条回答
  •  Happy的楠姐
    2020-12-12 17:47

    General, non-NDA-infringing answer:

    If you don't want something sticking out of a layer, mask the layer to its bounds.

    [self.layer setMasksToBounds:YES];
    

    Set the height explicitly to 44 (or 32 for landscape on iPhone) if that doesn't work on its own.

提交回复
热议问题