I have same issue with tvOS, kindly advice ?
Post
Replies
Boosts
Views
Activity
@Benzy_Neez thank you for the great solution. It fixed our issue.
sad situation. The product team wants the page to be opened as a sheet instead of a full screen cover, but we faced a lot of problems. We solved it by giving navigationview .id() but in this case, since the scroll in the nagitaion view was redrawn, it moved the page from the bottom to the top.
I finally got rid of this problem.
In my application, lastly, I was making a city search using Mapkit. I was showing the location of the word the user was searching for on the screen as a map. They agreed to delete the map.
I have the same issue. I gave hours to develop, but getting this result lost my motivation.
I have same issue :(
Thanks for update Adel,
I change your code below,
import SwiftUI
struct ScrollViewRTL<Content: View>: View {
@ViewBuilder var content: Content
@Environment(\.layoutDirection) private var layoutDirection
var type: RowType
init(type: RowType, @ViewBuilder content: () -> Content) {
self.type = type
self.content = content()
}
@ViewBuilder var body: some View {
ScrollView(type.scrollAxis, showsIndicators: false) {
content
.rotation3DEffect(Angle(degrees: layoutDirection == .rightToLeft ? -180 : 0), axis: (
x: CGFloat(0),
y: CGFloat(layoutDirection == .rightToLeft ? -10 : 0),
z: CGFloat(0)))
}
.rotation3DEffect(Angle(degrees: layoutDirection == .rightToLeft ? 180 : 0), axis: (
x: CGFloat(0),
y: CGFloat(layoutDirection == .rightToLeft ? 10 : 0),
z: CGFloat(0)))
}
}
public enum RowType {
case hList
case vList
var scrollAxis: Axis.Set {
switch self {
case .hList:
return .horizontal
case .vList:
return .vertical
}
}
}