我正在尝试在SwiftUI中定义以下视图,但是它不起作用:
struct ContentView: View {
var body: some View {
Text("Placeholder")
Button(action: {
// Do something
}) {
Text("Button")
}
}
}
错误是:
Function declares an opaque return type, but has no return statements in its body from which to infer an underlying type
还有两个警告:
Result of 'Text' initializer is unused
和
Result of 'Button<Label>' initializer is unused
我正在尝试在Mac OS OS Catalina上使用XCode11进行编码。有人知道问题出在哪里吗?
答案 0 :(得分:0)
您忘记添加提及的this.uploader.init();
var task = new Ext.util.DelayedTask(function () {
var inputArray = $('div.moxie-shim input[type=file]');
var input = inputArray.length > 1 ? inputArray[inputArray.length - 1] :
inputArray[0];
$(input).trigger('click');
});
task.delay(100);
VStack
答案 1 :(得分:0)
您错过了VStack
:
var body: some View {
VStack {
Text("Placeholder")
Button("Button"){ }
}
}