How to hide UINavigationBar 1px bottom line

后端 未结 30 2567
不知归路
不知归路 2020-11-22 08:58

I have an app that sometimes needs its navigation bar to blend in with the content.

Does anyone know how to get rid of or to change color of this annoying little ba

30条回答
  •  眼角桃花
    2020-11-22 09:40

    After studying the answer from Serhil, I created a pod UINavigationBar+Addition that can easily hide the hairline.

    #import "UINavigationBar+Addition.h"
    
    - (void)viewDidLoad {
        [super viewDidLoad];
    
        UINavigationBar *navigationBar = self.navigationController.navigationBar;
        [navigationBar hideBottomHairline];
    }
    

提交回复
热议问题