所以,我不想在某些条件下关闭动作模式。所以试着做以下
_ = Timer.scheduledTimer(timeInterval: time, target: self, selector: #selector(GameScene.method), userInfo: nil, repeats: false)
func method() {
//Do your task
time += 0.95 //increase timer
//Schedule it again
_ = Timer.scheduledTimer(timeInterval: time, target: self, selector: #selector(GameScene.method), userInfo: nil, repeats: false)
}
但每次按下按钮时它仍然会关闭CAB。 可能是什么原因?
答案 0 :(得分:0)
在styles.xml文件中添加
<!-- It should be true otherwise action mode will not overlay toolbar -->
<item name="windowActionModeOverlay">true</item>
<!-- For Custom Action Mode Background Color/Drawable -->
<item name="actionModeBackground">@color/colorAccent</item>