I resolved the issue after removing UIView.appearance().semanticContentAttribute = .forceRightToLeft from AppDelegate and set sematicContentAttribute of baseview.
Post
Replies
Boosts
Views
Activity
Please check FB13300264
If your app only support RTL language then you can make you development language to Arabic and removed all localized file and Localized resources from Info.plist.
Also UIView.appearence.sementicContentAttribute code. Then try to build and run. All UI and share option are in RTL.
A good example is here
https://ahmedk92.github.io/2018/08/10/Arabic-As-A-Default-Language-for-Your-iOS-App.html
struct HomeListView:View {
@State private var favoriteColor = 0
var body: some View {
VStack {
Picker("What is your favorite color?", selection: $favoriteColor) {
Text("Red").tag(0)
Text("Green").tag(1)
}
.pickerStyle(.segmented)
.padding(EdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8))
selectedView
}
.navigationBarTitleDisplayMode(.inline)
}
@ViewBuilder var selectedView: some View {
switch favoriteColor {
case 0:
HomeViewListing()
default:
TestListingView()
}
}
}
struct HomeViewListing:View {
var body: some View {
ScrollView {
LazyVStack {
ForEach(0..<100) { item in
Text("\(item)")
}
}
}
.scrollIndicators(.hidden)
}
}
struct TestListingView:View {
var body: some View {
ScrollView {
LazyVStack {
ForEach(0..<100) { item in
Text("\(item)")
}
}
}
.scrollIndicators(.hidden)
}
}
Steps to reproduce
1)Scroll HomeListingView item to 98
2)Change segment control( to TestListingView)
3)Change segment control again(to HomeListingView)
Scroll position is changed now to 0 but it should be at position 98(step 1 )
Scroll Position of HomeViewListing after changing segment to MostPopularView. If scroll HomeViewListing to end and changing segment to MostPopularView and then again to changing to HomeViewListing so this time HomeViewListing should be end of page but it is not
Crash is not occurring if I am making UITextView isScrollable property to TRUE (which is not my requirement).
I have fixed the issue by making isScrollable property to TRUE and re-calculating content size so that is scrolling behavior will not be visible.