问题描述
限时送ChatGPT账号..假设我有 5 个页面,如果我在第 1 页上,我可以以编程方式加载第 5 页吗?
Imagine I have 5 pages, If I'm on page 1 can I programmatically load page 5?
我知道使用 becomeCurrentPage 来加载初始页面,但不知道如何切换它(如果可能的话).
I'm aware of using becomeCurrentPage to load the initial page but not of how to switch it (if at all possible).
推荐答案
当你想切换并让你想要的 InterfaceController 作为这个通知的观察者时,你可以发送一个 NSNotificaton
帖子.在观察者的选择器里面.调用 [self beconmeCurrentPage]
.它对我有用,我希望它也对你有用.
You can send post an NSNotificaton
whenever you want to switch and have your desired InterfaceController as an observer for this notification. And inside the selector of the observer. call [self beconmeCurrentPage]
. It worked for me and i hope it works for you as well.
这篇关于您可以更改 WatchKit PageView 中的选定页面吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论