//swift
var backGroundImage = UIImage(named: "顶部Bar")
        backGroundImage = backGroundImage?.resizableImage(withCapInsets: UIEdgeInsets.zero, resizingMode: UIImageResizingMode.stretch)
        
        nav.navigationBar.setBackgroundImage(backGroundImage, for: .default)
     nav.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white]
//OC
UIImage *backGroundImage = [UIImage imageNamed:@"顶部Bar"]; backGroundImage = [backGroundImage resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeStretch]; [self.navigationBar setBackgroundImage:backGroundImage forBarMetrics:UIBarMetricsDefault];

 

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-12-11
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案