如何在手表应用中添加页面控件
How to add Page Control in watch application
我见过几个使用页面控件在手表应用程序的屏幕之间导航的应用程序。但我想知道我们如何在手表界面中添加该控件。请帮忙。
为此使用 WKInterfaceController.reloadRootPageControllers。
示例如下:
WKInterfaceController.reloadRootPageControllers(withNames: ["first", "second"], contexts: nil, orientation: .horizontal, pageIndex: 0)
Call this method to create or modify your app’s page-based interface:
At launch time. Use this method to customize the set of pages you want displayed, and to set the scrolling orientation.
At runtime. Use this method to change the active set of pages or the orientation, adding or removing pages as needed.
注意:不建议同时使用两种导航类型:页面和模式。
我见过几个使用页面控件在手表应用程序的屏幕之间导航的应用程序。但我想知道我们如何在手表界面中添加该控件。请帮忙。
为此使用 WKInterfaceController.reloadRootPageControllers。
示例如下:
WKInterfaceController.reloadRootPageControllers(withNames: ["first", "second"], contexts: nil, orientation: .horizontal, pageIndex: 0)
Call this method to create or modify your app’s page-based interface: At launch time. Use this method to customize the set of pages you want displayed, and to set the scrolling orientation. At runtime. Use this method to change the active set of pages or the orientation, adding or removing pages as needed.
注意:不建议同时使用两种导航类型:页面和模式。