iPad Pro 上的 SwiftUI NavigationView [英] SwiftUI NavigationView on the iPad Pro
问题描述
我使用 Apple SwiftUI 教程代码.然后我将 previewDevice 设置为 iPad Pro(12.9 英寸).但是预览有问题.有谁知道问题出在哪里?
I use the Apple SwiftUI tutorial code. Then I set the previewDevice to iPad Pro (12.9-inch). But the preview has something wrong. Does anyone know where the problem is?
推荐答案
您可以覆盖 iPad 上使用的默认 splitView,方法是让 NavigationView 显示您在 iPhone 上看到的相同堆叠视图,通过设置.navigationViewStyle(StackNavigationViewStyle())
You can override the default splitView used on iPad, by having the NavigationView display the same stacked view you see on iPhone, by setting
.navigationViewStyle(StackNavigationViewStyle())
在开发和调试过程中以及当您尚未开发 detailsView() 时非常有用.
Quite helpful during development and debugging, and when you have not developed the detailedView() yet.
这篇关于iPad Pro 上的 SwiftUI NavigationView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!