79582418

Date: 2025-04-19 13:04:19
Score: 0.5
Natty:
Report link

You can change the offset, let suppose you have TabView you can get height of sheet and update offset.enter image description here

struct DemoView: View {
    @State var isPresented = false
    var body: some View {
        ZStack {
            Color.brown
                .ignoresSafeArea()
            VStack {
                Button {
                    isPresented.toggle()
                } label: {
                    Text("Show Sheet")
                }
                .buttonStyle(.borderedProminent)
                Spacer()
                TabView {
                    Text("First Tab")
                        .tabItem {
                            Label("Home", systemImage: "house.fill")
                        }
                    Text("Second Tab")
                        .tabItem {
                            Label("Gallery", systemImage: "photo")
                        }
                    Text("Third Tab")
                        .tabItem {
                            Label("Comment", systemImage: "message")
                        }
                    Text("Fourth Tab")
                        .tabItem {
                            Label("Settings", systemImage: "gear")
                        }
                }
                .offset(y: isPresented ? -100 : 0)
                .sheet(isPresented: $isPresented) {
                    Text("my news page")
                        .presentationDetents([.height(100), .fraction(0.9)])
                }
                
            }
            
        }
        
    }
}
Reasons:
  • Blacklisted phrase (1): enter image description here
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Vaibhav Upadhyay