【发布时间】:2021-09-05 20:49:11
【问题描述】:
我的女巫上有一个屏幕,只显示文本,但是当我尝试在我的组视图中添加超过 10 个视图时,我收到了这个错误。我试图用组视图包装 VStack,但没有任何改变
Extra argument in call
我的代码:
struct GoalTipsView: View {
var body: some View {
NavigationView {
ScrollView {
VStack(alignment: .leading) {
Group {
HStack(spacing: 5) {
Text("Using the")
Text("Smart").bold()
Text("format is important for")
Spacer()
}.padding(.leading, 7)
HStack(spacing: 5) {
Text("structuring goals correctly and increases the")
}.padding(.leading, 7)
HStack(spacing: 5) {
Text("chance of success").bold()
}.padding(.leading, 7)
.padding(.bottom, 35)
HStack(spacing: 5) {
Text("SPECIFIC").bold().font(.system(size: 23))
}.padding(.leading, 10)
HStack(spacing: 5) {
Text("(Goals that are simple, sensible, significant.) \n A specific goal allows you to focus on a clear and specific target. It can help you visualise the desired outcome and makes it easier to track your progress. Focusing the mind on the desired goals is important for success. Every word needs to be useful and necessary in the goal sentence.").padding(5)
}.padding(.leading, 7)
HStack(spacing: 5) {
Text("MEASURABLE").bold().font(.system(size: 23))
}.padding(.leading, 10)
.padding(.top, 23)
HStack(spacing: 5) {
Text("(goals that are meaningful, motivating.) \n If your goal isn't measurable, there will be no way to determine if it\'s achieved. Work out the criteria for measuring progress towards the achievement of the goal. \n When the goal is measured you, are much more likely to keep on track, reach milestones, and experience the achievement that is needed for continued effort required to reach the goal.").padding(5)
}.padding(.leading, 10)
HStack(spacing: 5) {
Text("To assist with making the goal measurable:").bold().font(.system(size: 18))
}.padding(.leading, 10)
.padding(.top, 20)
HStack(spacing: 5) {
Text("How will i know when it is accomplished? \n What exactly needs to happened to consider this goal achieved?").padding(5)
Spacer()
}
HStack(spacing: 5) {
Text("ASSIGNABLE/ACTION-ORIENTED").bold().font(.system(size: 23))
}.padding(.leading, 10)
.padding(.top, 23)
HStack(spacing: 5) {} // Extra argument in call
}
}.padding(.top, 10)
}.navigationBarHidden(true)
}
}
}
struct GoalTipsView_Previews: PreviewProvider {
static var previews: some View {
GoalTipsView()
}
}
【问题讨论】: