Reputation: 3348
I have this ScrollView:
<ScrollView orientation="horizontal" horizontalAlignment="center" android:layoutDirection="rtl">
I try change direction scrollView , but not work for me.
But exist private function isLayoutRtl in tns-core-modules-widgets
private boolean isLayoutRtl() {
return (this.getLayoutDirection() == LAYOUT_DIRECTION_RTL);
}
I can change orientation horizontal ,But not change scroll rtl. mor information visit link.
How change directoin RTL scroll in scroll View?
Tanks
Upvotes: 1
Views: 543
Reputation: 11
I searched a lot and didn't find an official solution. But to keep things working, scroll to the end of the scrollView
after loading it:
onScrollViewLoaded(){
setTimeout(()=>{
let scrollView = this.$refs.scrollView.nativeView;
scrollView.scrollToHorizontalOffset(scrollView.scrollableWidth, false)
},1);
},
Upvotes: 1
Reputation: 3550
The direction can be set by the orientation
property. Is that indeed what you need? https://docs.nativescript.org/api-reference/classes/_ui_scroll_view_.scrollview.html#orientation
Upvotes: 2