I have created List in SwiftUI, but it has extra padding for divider (separator), I want to reduce that leading padding and make same padding for trailing and leading.
var body: some View {
NavigationView() {
List(modelData) { weather in
HStack {
Image(systemName: weather.image)
.frame(width: 50, height: 10, alignment: .leading)
Text("\(weather.temp)º")
.frame(width: 50, height: 10, alignment: .leading)
VStack {
Text(weather.city)
}
}.font(.title)
}
.navigationBarTitle(Text("World Weather"))
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.