When you turn the ScrollView
left to right, and try to scroll, content jumps to the other side. Is there any way to prevent this?
Main:
var body: some Scene {
WindowGroup {
ContentView()
.environment(\.layoutDirection, .rightToLeft)
}
}
ContentView:
struct ContentView: View {
var body: some View {
ScrollView(.horizontal) {
HStack {
Image(systemName: "circle.fill")
.imageScale(.large)
.foregroundStyle(.tint)
Text("مَملَكة")
Image(systemName: "square.fill")
.imageScale(.large)
.foregroundStyle(.tint)
Text("اخبرك")
Image(systemName: "heart.fill")
.imageScale(.large)
.foregroundStyle(.tint)
Text("عِلاجيّ")
}
.padding()
}
}
}