mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Allow toggling of visible scrollbar indicators (#4523)
* Allow toggling of visible scrollbar indicators * Add unit test * Make what the prop does more clear * Fix tslint * Rename property per @vakrilov * Missed string property rename * Move property from method * Update orientationChanged to use new property name
This commit is contained in:

committed by
Alexander Vakrilov

parent
57cf2314ee
commit
3dbcf088be
@ -1,5 +1,5 @@
|
||||
import { ScrollEventData } from ".";
|
||||
import { ScrollViewBase, layout } from "./scroll-view-common";
|
||||
import { ScrollViewBase, layout, scrollBarIndicatorVisibleProperty } from "./scroll-view-common";
|
||||
|
||||
export * from "./scroll-view-common";
|
||||
|
||||
@ -44,6 +44,17 @@ export class ScrollView extends ScrollViewBase {
|
||||
return nativeView.getScrollableLength() / layout.getDisplayDensity();
|
||||
}
|
||||
|
||||
[scrollBarIndicatorVisibleProperty.getDefault](): boolean {
|
||||
return true;
|
||||
}
|
||||
[scrollBarIndicatorVisibleProperty.setNative](value: boolean) {
|
||||
if (this.orientation === "horizontal") {
|
||||
this.nativeView.setHorizontalScrollBarEnabled(value);
|
||||
} else {
|
||||
this.nativeView.setVerticalScrollBarEnabled(value);
|
||||
}
|
||||
}
|
||||
|
||||
public scrollToVerticalOffset(value: number, animated: boolean) {
|
||||
const nativeView = this.nativeView;
|
||||
if (nativeView && this.orientation === "vertical") {
|
||||
|
Reference in New Issue
Block a user