美文网首页
iOS 11.2的系统 barButtonItem点击会保持高亮

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

作者: 开洋_shen | 来源:发表于2018-04-13 20:44 被阅读0次

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点击会保持高亮

      本文链接:https://www.haomeiwen.com/subject/evphkftx.html