我正在尝试在Xcode中创建一个简单的主/详细应用程序。
我希望详细视图是
struct EditingView: View
{
var body: some View {
var mainVertical: VStack = VStack() //error here
{
var previewArea: HStack = HStack()
{
var editorButton: Button = Button()
//the same with return editorButton
// I have to add other controls,like a WKWebView
}
return previewArea
//this is a simple version,layout will have other stacks with controls inside
}
return mainVertical
}
}
但我知道
Generic parameter 'Content' could not be inferred
IDE为我提供了修复程序,但是如果这样做,它会写一个我必须填写的通用类型,但随后会出现其他错误,例如f.i。如果我将AnyView或TupleView放进去。
我希望它可以推断一切,它不能理解的错误是什么?