您可以更改 WatchKit PageView 中的选定页面吗 [英] Can you change the selected page in WatchKit PageView

查看:22
本文介绍了您可以更改 WatchKit PageView 中的选定页面吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆