我一直在尝试使用Swift UI为iOS 13创建一个应用程序,但我不断收到这个奇怪的错误:“对成员'buildBlock()'的引用不明确”。
无论我做什么,错误都不会消失。
我尝试一次注释部分代码,以查看可能是引起问题的部分,但是唯一起作用的是注释掉整个视图。
我试过清理构建文件夹并删除派生数据。我还尝试过多次重启计算机和Xcode,但没有任何修复措施。
我很确定这只是一个Xcode错误,但是必须解决它,如果有人能告诉我那是什么,我将非常感谢。
var body: some View {
GeometryReader { geometry in {
VStack {
Button (action: self.editProfilePicture) {
Image(ImageNames.AccountIconImageName, bundle: Bundle.main)
.resizable()
.frame(width: geometry.size.width / SizeConstants.AccountIconSizeDiviser, height: geometry.size.width / SizeConstants.AccountIconSizeDiviser)
.padding()
.background(ColorConstants.VeryLightGrayColor)
.clipShape(Circle())
}
.accentColor(.white)
.padding(.bottom, LargePadding)
ScrollView (showsVerticalIndicator: false) {
let const: Length? = geometry.size.width - SizeConstants.FullNameTextFieldWidthReduction
TextBox(textBinding: self.$fullName, placeHolder: Text(Strings.FullNameString), editChanged: self.fullNameChanged)/*.padding(.bottom, SmallPadding)*/.frame(width: const)
TextBox(textBinding: self.$username, placeHolder: Text(Strings.UsernameString), editChanged: self.usernameChanged)//.padding(.bottom)
Text(verbatim: Strings.ChooseIdType).font(.footnote).color(.gray)
TextBox(textBinding: self.$phoneNumber, placeHolder: Text(Strings.PhoneNumberString), editChanged: self.phoneNumberChanged)//.padding(.bottom, SmallPadding)
TextBox(textBinding: self.$emailAddress, placeHolder: Text(Strings.EmailAddressString), …Run Code Online (Sandbox Code Playgroud)