IOS development of a simple code to hide the navigation bar line


Remove the line on the NavigationBar:

///Hide the NavigationBar navigation bar line (write it directly in the UINavigationController viewdidload method)
  UIView *backgroundView = [self.navigationBar subviews].firstObject;
  _lineView = backgroundView.subviews.firstObject;
  _lineView.hidden = YES;

Before removal (renderings):

After removal (renderings):


The above is the simple code of the hidden navigation bar line developed by IOS introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time!