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

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;
}
}

你可能感兴趣的:(iOS 11.2的系统 barButtonItem点击会保持高亮)