0

I recently updated to Xcode 13 and I'm facing an issue with one image in my App

This is the same view with the same code in the same device but different iOS versions: enter image description here

The image I'm using is this (Is a screenshoot instead of original image because original is over 2MB max limit image size of Stack Overflow):

enter image description here

The code:

struct HomeView: View {
@State private var navigateTo: Int? = Links.NIL

// Navigation in root and accent color change.
@Binding var rootViewLinks: RootView.Links
@State var navigationAccentColor: Color = Color(R.color.d_primary()!)

var body: some View {
    
    NavigationView{
        VStack{
            //Logo and title
            HStack{
                Image(R.image.ic_logo_miloto_white.name)
                    .resizable()
                    .frame(width: 48, height: 56, alignment: .center)
                    .aspectRatio(contentMode: .fill)
                
                Text("miloto")
                    .fontWeight(.bold)
                    .foregroundColor(.white)
                    .font(.system(size: 48))
                    .labelStyle(CustomLabelStyle())
            }
            
            Spacer()
            
            //Welcome text
            Text(R.string.localizable.homeSlogan())
                .fontWeight(.bold)
                .labelStyle(CustomLabelStyle())
                .foregroundColor(.white)
                .padding()
            
            //Action buttons
            HStack{
                //ACCESS NAVIGATION
                NavigationLink(
                    destination: AccessView(rootViewLinks: self.$rootViewLinks, navigationAccentColor: self.$navigationAccentColor),
                    tag: Links.ACCESS,
                    selection: $navigateTo){
                         Button(R.string.localizable.login_text()){
                            navigateTo = Links.ACCESS
                         }
                         .buttonStyle(PrimaryInvertedButtonStyle_W())
                }
                
                //REGISTER NAVIGATION
                NavigationLink(
                    destination: RegisterView(rootViewLinks: self.$rootViewLinks, navigationAccentColor: self.$navigationAccentColor),
                    tag: Links.REGISTER,
                    selection: $navigateTo){
                        Button(R.string.localizable.register_text()){
                            navigateTo = Links.REGISTER
                        }
                        .buttonStyle(PrimaryButtonStyle_W())
                }
            }.padding(.horizontal)
            
            //Tour text
            NavigationLink(
                destination: TourView(pages: TourPage.getHomeTutorialPages()),
                tag: Links.TOUR,
                selection: $navigateTo
            ) {
                HStack {
                    Text(R.string.localizable.tour_text())
                        .fontWeight(.bold)
                        .labelStyle(CustomLabelStyle())
                        .foregroundColor(.white)
                    Image(R.image.ic_plane.name)
                }
                .padding(.vertical)
            }
        }
        .background(
            Image(R.image.bg_home_big.name)
                .resizable()
                .aspectRatio(nil, contentMode: .fill)
                .ignoresSafeArea()
        )
    }
    .accentColor(navigationAccentColor)
}

But you should focus on this:

        .background(
            Image(R.image.bg_home_big.name)
                .resizable()
                .aspectRatio(nil, contentMode: .fill)
                .ignoresSafeArea()
        )

**Why is image fill not working on iOS 15? Is this a bug? **

0 Answers0