HomeiOS Developmentget a swiftUI sheet to occupy more room on an ipad

get a swiftUI sheet to occupy more room on an ipad [duplicate]


The beneath code is easy check code. It reveals a view with a button. When the button is pressed, a sheet pops up. On an iphone, the sheet takes up a lot of the house. On an ipad in portrait mode, solely about half the peak is used, with 25% padding on the prime and backside. In panorama mode it makes use of extra top. I am really effective with the conduct on an iphone or ipad in panorama, it is the portrait mode that I would need extra top, perhaps 10% padding on the prime/backside.

What appears to be taking place is that swift is already deciding the max top this sheet goes to be, presentationDetents() and many others, does not do a factor. And sure, I requested 3 completely different AIs and so they all failed.

Anyone remedy this downside?

Thx.


import SwiftUI

struct ContentView: View {
    @State personal var isSheetPresented = false

    var physique: some View {
        VStack {
            Button("Present Sheet") {
                isSheetPresented = true
            }
            .font(.title)
            .padding()
        }
        .sheet(isPresented: $isSheetPresented) {
            SheetView()
        }
    }
}

struct SheetView: View {
    var physique: some View {
        VStack {
            Textual content("That is the sheet content material!")
                .font(.title)
                .padding()
        }
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments