HarmonyOS Navigation如何适配pad?

现在使用pad显示分屏,请问如何适配pad

Navigation(this.rootPath) {
  // NavDestination() {
  Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.tabsController }) {
    ForEach(new HomeTabManager().tabData,
      (item: HomeTabData, index: number) => {
        TabContent() {
          if (index == 0) {
            FileHomePage()
          } else if (index == 1) {
            MineHomePage()
          } else {
            this.HolderPage(item.title)
          }
        } .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
        .tabBar(this.tabBuilder(item, index))
      },
      (item: HomeTabData, index: number) => {
        return item.tag
      })
  }.homeTabStyle()
  .barOverlap(false)
  .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  .onContentWillChange((currentIndex: number, comingIndex: number) => {
    this.currentIndex = comingIndex;
    return true
  })
  .onChange((index) => {
    this.currentIndex = index;
  })


}
.hideToolBar(true)
.hideTitleBar(true)
阅读 519
1 个回答

可以添加属性.mode(NavigationMode.Stack)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进