Learn Courses My Dashboard

14 Day Beginner Challenge (SwiftUI) - Lesson 4 Challenge

Hello everyone. I have completed(?) the Challenge for Lesson 4, but for some reason the modifiers I am assigning to modify an entire z-stack is not working as intended. It is only modifying the latest text element. What am I doing wrong?

Hi @botaybry

Welcome to the community.

Move the modifiers .backgroundColor, .cornerRadius, .opacity and .foregroundColor down to the bottom closing brace of the VStack which contain the text elements. You will also need to add some padding above those modifiers so that you create some space around the elements within the VStack before you apply the other modifiers.

Ah!! So that was what I was missing! Thank you very much!