2

I am trying to make the background of screen to be Image not color. I want to know what should be the image sizes, and what to change in these values.

GeometryReader { geometry in
             ZStack {
                Image("Home-BG")
                .resizable()
                .edgesIgnoringSafeArea(.all)
                .aspectRatio(contentMode: .fill)

I want the image to be fit to screen in all iphone and ipad available devices.

2
  • I didn't really get what's the problem here. Your code make the image fill the screen as a background as expected. What is the result you get and what is the result you'd like to achieve? Commented Oct 9, 2019 at 15:48
  • what are image sizes should I use? Commented Oct 10, 2019 at 5:23

1 Answer 1

5

Try

    ZStack {            
        Image("BackGroundImage")
            .resizable()
            .edgesIgnoringSafeArea(.all)

    }
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.