您可以更改 WatchKit PageView 中的选定页面吗

编程入门 行业动态 更新时间:2024-10-08 02:19:51
本文介绍了您可以更改 WatchKit PageView 中的选定页面吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-26 21:34:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142750.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:您可以   页面   WatchKit   PageView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!