Black screen page on apple watch apps with more that one page

孤者浪人 提交于 2021-01-29 09:51:07

问题


Hi I have created a Watch app which has two pages but when I run it on apple watch and do switch between pages after few seconds one page(sometimes page1 and sometimes page2)goes black and It doesn’t show my buttons, labels nothing. But when I run it on simulator there is no problem everything is fine and also before i add second page to the app It was ok on apple watch too


回答1:


I had the same issue and it was due to calling crownSequencer.focus() without a corresponding crownSequencer.resignFocus() call. In my case I was calling focus() in didAppear() and once I added a resignFocus() call to willDisappear() the problem went away.




回答2:


I guess if you remove override function didDeactivate() from both interfaceControllers may solve the problem but that's when you don't need this function and if you do try user899076 answer.

remove this:

override func didDeactivate() {
    // This method is called when watch view controller is no longer visible
    super.didDeactivate()
}


来源:https://stackoverflow.com/questions/59458640/black-screen-page-on-apple-watch-apps-with-more-that-one-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!