【发布时间】:2019-11-22 21:36:50
【问题描述】:
我有一个从“ContentView”中的列表访问的“DetailView”。在这个 DetialView 中,文本太多,我不知道如何在 NavigationView 中添加 ScrollView(或者是否正确添加)。 here you can see why I need a scroll
我尝试在 NavigationView 之后添加 ScrollView(在信息的 VStack 上方),但没有任何运气。
struct DetailView: View {
var selectedGrape: Grape
var body: some View {
return NavigationView {
VStack {
Text(selectedGrape.grapeName)
.font(.largeTitle)
.foregroundColor(.blue)
Text("Characteristics")
.font(.title)
.fontWeight(.bold)
.padding(.top)
Text(selectedGrape.grapeCharacteristics)
}
}
}
}
它根本无法构建
【问题讨论】:
-
我看不到以前的问题回答了这个问题,因为这是在新的 Swift 5.0 中完成的