I have a view which looks like this:
And here is its the code:
struct SettingController: View {
var body: some View {
NavigationView() {
MainList()
.navigationBarTitle("Settings")
}
}
}
Now I add a code to add a button to navigationView like so:
struct SettingController: View {
@State var isToggle: Bool = false
var body: some View {
NavigationView() {
MainList()
.navigationBarTitle("Settings")
.navigationBarItems(trailing:
HStack {
Button("Unlock All") {
isToggle.toggle()
}.sheet(isPresented: self.$isToggle) {
SubscriptionModalView()
}
})
}
}
}
But the results came out like this:
How do I get rid of those paddings!?
List(..) {
ListItem {
..
}
.listStyle(PlainListStyle())
}
Try using PlainListStyle