Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.05k stars 1.37k forks source link

背景色都是白色 push 或手势返回时 会有一层灰色渐变的效果,怎样可以去除 #1467

Closed locooo closed 1 year ago

locooo commented 1 year ago

Bug 表现 push 或手势返回时 会有一层灰色渐变的效果,怎样可以去除

截图

WechatIMG684

如何重现 vc1 和vc2都继承 JYBaseViewController // // JYBaseViewController.swift // ZhangGuanJiaPro // // Created by locoo on 2022/12/9. //

import UIKit

class JYBaseViewController: UIViewController { override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) } required init?(coder: NSCoder) { super.init(coder: coder) } override func viewDidLoad() { super.viewDidLoad() self.navigationController?.view.backgroundColor = UIColor.white; self.view.backgroundColor = UIColor.white self.navigationController?.delegate = self; } }

extension JYBaseViewController: QMUINavigationControllerDelegate {

// @objc func preferredNavigationBarHidden() -> Bool { // return false // }

//MARK: 是否隐藏导航栏
/// 是否隐藏导航栏
/// - Returns: true 隐藏
@objc func preferredNavigationBarHidden() -> Bool {
    return false
}

/// 必须开启才能在单独的VC中设置导航栏的显示和隐藏
/// - Returns: true 可以单独设置
func shouldCustomizeNavigationBarTransitionIfHideable() -> Bool {
    return true
}

//MARK: titleViewd 的tintColor
/// titleView 的tintColor
/// - Returns: color
func qmui_titleViewTintColor() -> UIColor? {
    return UIColor.red
}

//MARK: navBar 背景色
/// navBar 背景色
/// - Returns: Image
func qmui_navigationBarBackgroundImage() -> UIImage? {
   return UIImage.qmui_image(with: UIColor.red)
}

//MARK: 导航栏阴影
/// 导航栏阴影
/// - Returns: Image
func qmui_navigationBarShadowImage() -> UIImage? {
    return nil
}

/// 导航栏barTintColor
/// - Returns: color
func qmui_navigationBarBarTintColor() -> UIColor? {
    return UIColor.white
}

/// 设置当前导航栏的 barStyle
/// - Returns: UIBarStyle
func qmui_navigationBarStyle() -> UIBarStyle {
    .default
}

func containerViewBackgroundColorWhenTransitioning() -> UIColor? {
    return UIColor.white
}

}

预期的表现 正常情况下,应该是什么表现 push 和手势返回 没有阴影渐变
其他信息

MoLice commented 1 year ago

这是系统的效果,无法去除。你可以自行摸索然后用各种私有方式去处理。