iOS 7 : Disable UINavigationBar Translucency For Entire App

后端 未结 9 1850
Happy的楠姐
Happy的楠姐 2020-12-14 14:12

Is there a way to disable UINavigationBar Translucency for an entire application?

I\'m aware that using [self.navigationController.navigationBar setTranslucent

9条回答
  •  借酒劲吻你
    2020-12-14 14:31

    I know this is old, but this might come in handy for someone;

    You can use a category, and within it* set the property [translucent][1]

    @implementation UINavigationBar (MakeTranslucent)
    
    -(void)willMoveToWindow:(UIWindow *)newWindow {
        [super willMoveToWindow:newWindow];
    
    
        self.translucent = NO;
    }
    @end
    
    • I used willMoveToWindow, I do not know whether this is a good idea so UAYOR.

提交回复
热议问题