小编Joh*_*Oin的帖子

iOS - 按下后退按钮时的导航栏颜色转换

在导航堆栈中使用barTintColor时,我正在尝试更改导航栏的颜色,使用barTintColor(_:willShow:animated :).

这是代码:

  func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
    if viewController is ViewerViewController {
      navigationBar.barTintColor = UIColor(custom: .white)
      navigationBar.tintColor = UIColor(custom: .black)
    } else if viewController is FeedViewController {
      navigationBar.barTintColor = UIColor(custom: .blue)
      navigationBar.tintColor = UIColor(custom: .white)
    }
  }
Run Code Online (Sandbox Code Playgroud)

当我按下视图控制器并使用滑动后退手势时,一切都很美妙(颜色过渡在两个方面都很平滑).

但是,当我按下后退按钮时,颜色最初不会改变,导航过渡完成,然后颜色改变而没有动画.

有人已经遇到/解决了这个问题吗?任何线索将不胜感激.

transition colors uinavigationbar ios

7
推荐指数
1
解决办法
1505
查看次数

使用Haxe将参数传递给延迟函数

你知道是否有一种简单的方法可以将一些参数传递给一个名为via的函数

haxe.Timer.delay(func, delay);
Run Code Online (Sandbox Code Playgroud)

"简单"我的意思是不创建任何自定义计时器.

arguments haxe timer delay

2
推荐指数
1
解决办法
3104
查看次数

标签 统计

arguments ×1

colors ×1

delay ×1

haxe ×1

ios ×1

timer ×1

transition ×1

uinavigationbar ×1