Styling the UI
In ContentView
, let’s add some more features for the user; we’ll a background, some animations to the game, as well as a word count and language display label. Adding some more styling will help the UI come alive.
Adding the background
We’ll start by adding a background to the scene. We currently have a title and buttons that are styled with a wooden look, so let’s continue the wooden theme and use a wood image as a background. Add the following code after the closing brace of VStack
:
.background(Image("background").resizable() .edgesIgnoringSafeArea([.all]) .aspectRatio(contentMode: .fill) .frame(width: 500, height: 800))
This code sets a wooden image as the background and uses the edgesIgnoringSafeAreas
modifier to...