iOS 11.2的系统 barButtonItem点击会保持高亮

2018-04-13  本文已影响0人  开洋_shen

Swift

func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
if #available(iOS 11.2, *) {
navigationBar.tintAdjustmentMode = .normal
navigationBar.tintAdjustmentMode = .automatic
}
}

Objective-C

-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
if (@available(iOS 11.2, *)) {
self.navigationBar.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
self.navigationBar.tintAdjustmentMode = UIViewTintAdjustmentModeAutomatic;
}
}

上一篇 下一篇

猜你喜欢

热点阅读