Watchkit 下一页阻止按钮执行 segues。

Watchkit Next page preventing buttons from performing segues.

我正在开发一个 watchkit 应用程序,它有一个带有基于页面的导航的菜单屏幕(您可以在其中水平滑动以查看另一个控制器)。然而,菜单屏幕上本应导致推送转场的按钮(我在故事板编辑器中以图形方式进行转场)不再起作用。当我在情节提要编辑器中删除页面界面连接时,一切正常。谁能帮帮我?

watchOS 上基于页面的导航和分层导航是非此即彼的选择,您不能同时使用两者。

来自watchOS Human Interface Guidelines

A watchOS app may include more than one screen. When this is the case, choose the navigation model that best meets your needs: page-based or hierarchical. You can’t use both models in one app.

来自App Programming Guide for watchOS: Interface Navigation

For a Watch app interface with more than one screen of content, you must choose a technique for navigating between different screens. The Watch app interface supports two navigation styles, which are mutually exclusive:

  • Page based. This style is suited for apps with simple data models where the data on each page is not closely related to the data on any other page. A page-based interface contains two or more independent interface controllers, only one of which is displayed at any given time. At runtime, the user navigates between interface controllers by swiping left or right on the screen. A dot indicator control at the bottom of the screen indicates the user’s current position among the pages.

  • Hierarchical. This style is suited for master-detail interfaces, for presenting a navigable set of screens, or for cases where you might need to extend your app and add new content later. A hierarchical interface always starts with a single root interface controller. In that interface controller, you provide controls that, when tapped, push new interface controllers onto the screen.

Although you cannot mix page-based and hierarchical navigation styles in your app, you can supplement these base navigation styles with modal presentations. Modal presentations let you interrupt the current user workflow to request input or display information. You can present interface controllers modally from both page-based and hierarchical apps. The modal presentation itself can consist of a single screen or multiple screens arranged in a page-based layout.