Reputation: 1056
How do you adjust the vertical height of the .toolbar with SwiftUI? As seen in the image below, the toolbar is way too large (all I need it to do is just to fit those three items):
NavigationView {
VStack{
MapView()
}.toolbar {
ToolbarItem(placement: .principal) {
HStack(spacing: 20) {
Text("Toolbar")
Divider()
Button(action: {}) {Image(systemName: "plus.circle")}
Divider()
Button(action: {}) {Image(systemName:"arrowshape.turn.up.left.circle")
}
}
}
}
Upvotes: 2
Views: 1561
Reputation: 1474
struct ContentView: View {
var body: some View {
NavigationView {
VStack{
MapView()
}.toolbar {
ToolbarItem(placement: .principal) {
HStack(spacing: 20) {
Text("Toolbar")
Divider()
Button(action: {}) {Image(systemName: "plus.circle")}
Divider()
Button(action: {}) {Image(systemName:"arrowshape.turn.up.left.circle")
}
}
}
}
.navigationBarTitle("", displayMode: .inline)
}
}
}
Upvotes: 1