Building on @pkamb answer — to shrink the accessory view into the toolbar space, you can read the placement via:
@Environment(\.tabViewBottomAccessoryPlacement) var tabViewPlacement
This returns an enum with two cases: .expanded
and .inline
. You can provide different views for each case, for example:
.tabViewBottomAccessory {
switch tabViewPlacement {
case .expanded:
HStack {
Spacer().frame(width: 20)
Image(systemName: "command.square")
Text(".tabViewBottomAccessory")
Spacer()
Image(systemName: "play.fill")
Image(systemName: "forward.fill")
Spacer().frame(width: 20)
}
case .inline:
Text(".tabViewBottomAccessory")
Image(systemName: "play.fill")
Image(systemName: "forward.fill")
Spacer().frame(width: 20)
}
}
This way, you can simply omit or adjust icons in .inline
mode.