HomeiOS Developmentios - How do I make picture ignore protected space and go...

ios – How do I make picture ignore protected space and go over the selfie cam on the high


I wish to make the picture to disregard protected areas and attain the highest of the cellphone (previous the digital camera and the place time is proven)

That is the code I’ve proper now::

import SwiftUI

struct ArtistView: View {
    
    var artist: Artist
    
    var physique: some View {
        ScrollView {
            VStack {
                Picture("theWeeknd_banner")
                    .resizable()
                    .ignoresSafeArea(.container, edges: .high)
                    .scaledToFill()
                    .body(width: .infinity, top: 300)
                    // .offset(y: -59)
            }
        }
    }
}

It is just below the selfie digital camera however I wish to have it on the high of the cellphone like proven within the screenshot. Offsetting it by y: -59 brings it to the highest on a tool like iPhone 15 Professional however its an excessive amount of for the SE. That is the closest I bought to getting the end result I need.

enter image description here

I’ve additionally tried this from one other put up:

struct ArtistView: View {
    
    var artist: Artist
    
    var physique: some View {
        ScrollView {
            ZStack {
                Colour.clear
                    .background(
                        Picture("theWeeknd_banner")
                            .resizable()
                            .ignoresSafeArea()
                            .scaledToFill()
                            
                    )
            }
        }
    }
}

It is on the high however goes excessive and cuts off a little bit of the picture.

enter image description here

If anybody may assist with the picture filling right into a sure a top (so it might have the peak it must be and zoomed in a little bit of the width is an excessive amount of) it might be good too.

Hopefully it is sufficient information

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments