组件打开时,NativeScript ScrollView将滚动到某个部分

时间:2018-03-11 14:27:55

标签: angular nativescript angular2-nativescript nativescript-telerik-ui nativescript-angular

我在我的组件中使用ScrollView

        <ScrollView height="108"
                    orientation="horizontal"
                    sdkToggleNavButton>
                         .
                         .
                         .
                     some content
        </ScrollView>

滚动宽度大约为1200,我正在寻找某种方式,当组件打开时,它将显示在该scrollView的中间

1 个答案:

答案 0 :(得分:1)

使用scrollView.scrollToHorizontalOffset(position);