如何在SwiftUI中删除列表的左右填充?我创建的每个列表都有一个单元格的开头和结尾的边界。
我应该添加什么修饰符以删除此内容?
如何Form在 a 中顶部对齐a NavigationView。我有下面的,当我NaviagationView从身体上取下时,它Form是顶部对齐的。随着NavigationView到位,我在得到之间的间距(添加红色框来显示空间)。我可以.padding(.top, -20)在 Form 上使用,但是虽然这有效,但它会稍微扭曲一些东西。
NavigationView {
Form {
VStack {
HStack {
Text("Name:").underline().font(.headline)
TextField("Name", text: $routine.name)
}
roundPicker()
TimeSelectionView(stateName: "A", stateDuration: "0:30", stateBackground: "#df405a")
TimeSelectionView(stateName: "B", stateDuration: "1:30", stateBackground: "#4ea1d3")
TimeSelectionView(stateName: "C", stateDuration: "3:00", stateBackground: "#4f953b")
}
}
.navigationBarTitle("Create", displayMode: .inline)
.navigationBarItems(trailing:
Button(action: {
//Save Routine
self.routine.rounds = self.roundsArray[self.rounds]
print("Workout Name: \(self.routine.name)")
print("Workout Rounds: \(self.routine.rounds)")
}, label: {
Text("Save")
}
)
)
}
Run Code Online (Sandbox Code Playgroud)