Trying to figure out how to put the icons of the new SwiftUI toolbar on top of the text, like they are supposed to be on the bottom toolbar. Currently, they show up sideways, which is weird.
This is my piece of code that shows them
content.toolbar {
ToolbarItem(placement: .bottomBar) {
Button {
menu.value = .file
} label: {
Label(LocalizedStringKey("menu.file"),
systemImage: Symbol.SymbolEnum.sf_folder.systemName! )
}
}
ToolbarItem(placement: .bottomBar) {
Button {
menu.value = .export
} label: {
Label(LocalizedStringKey("menu.export"),
systemImage: Symbol.SymbolEnum.sf_square_and_arrow_up.systemName! )
}
}
}
I know it is simple to do a VStack, but I seriously thought this was the entire goal of a Label, to be able to provide something contextually adequate, and in this case, it would be a vertical orientation for the icon and text.
There is
LabelStyle
for this purpose, so we could configure labels as needed.So here is possible approach
and now apply it to entire toolbar or to needed labels only