in SwiftUI,my var has UIScreen.main.bounds.width.
@State private var buttonWidth: Double = UIScreen.main.bounds.width.
UIScreen.main.bounds.width Is deprecated. (main is deprecated) how can i solve?
thank you
in SwiftUI,my var has UIScreen.main.bounds.width.
@State private var buttonWidth: Double = UIScreen.main.bounds.width.
UIScreen.main.bounds.width Is deprecated. (main is deprecated) how can i solve?
thank you
Copyright © 2021 Jogjafile Inc.
Add the
.frame()modifier to your button in your view and let it occupy the screen width infinitelyHere's documentation on the frame modifier