I would like to know if there is any way with the bottom sheet SWIFTUI to build an app layout like Image Below, where a bottom sheet is displayed behind of a toolbar.
I tried to achieved it but didn't. ISSUE[A bottom sheet is displayed on top of a toolbar].
XCODE 14.0.1
CODE:
`
struct Track1: View {
var body: some View {
NavigationView{
ZStack() {
.toolbar {
**# MY BOTTOM TOOL BAR IS HERE **
ToolbarItem(placement:.bottomBar)
{
HStack(spacing:11){
Button{}label: {
VStack
{
Image(icon: .home_g)
.renderingMode(.template)
.resizable()
.frame(width: 30, height: 30)
Text("Home")
}
.frame(width: 65, height: 65)
.cornerRadius(25)
} } }
GeometryReader{
geo in
MapView(mapType: .standard,showsUserLocation: true)
**#
# MY BOTTOM SHEET IS HERE **
.sheet(isPresented: $shopListVM.showSheet) {
ZStack{
if #available(iOS 16, *) {
VStack{
Text("SHEET IS OPEN")
}
.presentationDetents([.medium, .fraction(0.1)])
}
else {
VStack{
Text("SHEET IS OPEN")
}
}
}
}
VStack(spacing:20){
VStack{
HStack{
Image(systemName: "magnifyingglass")
TextField("Search..",text: $searchText)
}
.padding()
.background(Color.white)
.cornerRadius(20)
.padding(.top,30)
.padding(.horizontal,30)
}
}
}
}
.accentColor(Color(hex: 0xFA6109))
}
}
}
`