问题
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