I want o create a simple background by tiling an image in a Z-stack.
I'm trying to scale down a large image while maintaining its aspect ratio, then tiling it across the entire screen to serve as a background.
I want to avoid editing the original image itselt and resizing it in a seperate software.
I tried the following - but only get a small portion of the image covering the screen:
import SwiftUI
struct MenuView: View {
var body: some View {
ZStack {
Image("BackgroundDoodle")
.resizable(resizingMode: .tile)
.frame(width: .infinity, height: .infinity, alignment: .center)
.ignoresSafeArea()
.opacity(0.8)
}
}
}