Hello,
I'm currently looking for solutions on how I would do an "inverted" spacer. I'm trying to stay away from using the .offset function, because it makes the resizing on different devices terrible. By the way, I'm using SwiftUI.
Hello,
I'm currently looking for solutions on how I would do an "inverted" spacer. I'm trying to stay away from using the .offset function, because it makes the resizing on different devices terrible. By the way, I'm using SwiftUI.
Could you explain what you mean ? And possibly show graphically ?
Spacer is done to create automatic space between views. Do you want to set a negative width to the Spacer ?
What is the issue using offset ? This creates a Spacer of -30:
struct ContentView: View {
var body: some View {
HStack {
Text("text")
.padding()
Text("More")
}
HStack {
Text("text")
.padding()
Text("More")
.offset(x: -30)
}
}
}