如何在原生脚本角度隐藏iOS的水平滚动指示器

时间:2019-02-06 07:19:13

标签: nativescript nativescript-angular radlistview

嗨,我正在使用NativeScript-Angular开发适用于iOS和Android的应用程序。我已经使用ListView插件创建了水平RadListView。一切正常,但滚动指示器不会在iOS中隐藏。

在Android中,滚动指示器已隐藏。如何在iOS中解决此问题?

我的HTML文件:

 <RadListView row="0" selectionBehavior="Press" (itemSelected)="onItemSelected($event)"  #menurad class="m-t-10" row="0" height="50"  [items]="allMenuList">
                <ng-template tkListItemTemplate let-themenu="item" let-i="index">
                        <StackLayout orientation="horizontal" (tap)="menuClick(i)" >
                                <Label class="Selected" [text]="themenu.menuName" ></Label>
                                <Label width="20"></Label>
                        </StackLayout>
                </ng-template>
                <ListViewLinearLayout tkListViewLayout scrollDirection="Horizontal"></ListViewLinearLayout>
        </RadListView>

2 个答案:

答案 0 :(得分:1)

iOS: myListView.ios.showsVerticalScrollIndicator = false;

android: myListView.android.setVerticalScrollBarEnabled(false);

上面的代码为我工作,用于隐藏“垂直”滚动。 您可以对Horizo​​ntalScrollIndicator尝试相同的操作...

答案 1 :(得分:1)

这应该适用于RadListView

onLoaded(event) {
    const listView = event.object;
    if (listView.ios) {
        listView.ios.collectionView.showsHorizontalScrollIndicator = false;

        // In case of vertical scrollbars uncomment the line below 
        // listView.ios.collectionView.showsVerticalScrollIndicator = false;
    }
}

Playground Sample