I would like to use HSTack to determine the width value on the UISscreen up to Image("test") and get the value. What should I do?
struct ContentView:View {
varbody:someView {
HSTack {
Text ("Apple")
.font (.largeTitle)
.frame (width: 200)
.background (Color.yellow)
Image ("test")
.resizable()
.frame (width:300, height:150)
}
}
}
It's solved.
.background() has a value similar to that obtained by GeometryReader.
© 2024 OneMinuteCode. All rights reserved.