Component - Frame modifier
The Frame modifier in SwiftUI sets the size and alignment of a view. It lets you fix width, height, or both, and control where the view sits inside that frame.
The Frame modifier in SwiftUI sets the size and alignment of a view. It lets you fix width, height, or both, and control where the view sits inside that frame.
VStack ├── Text └── Button
frame modifier do in SwiftUI?Rectangle() .fill(Color.red) .frame(width: 150, height: 100) .frame(width: 200, height: 200)
Text("Hello")
.frame(width: 100 height: 50)Pass the test and this pattern moves unknown