运行时版本为5.0.0的Android上的NativeScript ScrollView错误

运行时版本为5.0.0的Android上的NativeScript ScrollView错误,nativescript,Nativescript,ScrollView isUserInteractionEnabled参数在NativeScript运行时版本5.0.0上的行为与在Android的4.2.0上的行为不同 不需要脚本文件。您只需使用此XML即可观察此问题: <Page class="page" xmlns="http://www.nativescript.org/tns.xsd"> <ActionBar title="Horizontal Scroll Bug" class="action-bar"&g

ScrollView isUserInteractionEnabled参数在NativeScript运行时版本5.0.0上的行为与在Android的4.2.0上的行为不同

不需要脚本文件。您只需使用此XML即可观察此问题:

<Page class="page" xmlns="http://www.nativescript.org/tns.xsd">
    <ActionBar title="Horizontal Scroll Bug" class="action-bar">
    </ActionBar>
    <StackLayout>
        <Label text="ScrollView's isUserInteractionEnabled property is false."
            padding="10" textWrap="true" fontSize="20" />
        <ScrollView id="horizontalScroll" orientation="horizontal" isUserInteractionEnabled="false">
            <StackLayout orientation="horizontal">
                <StackLayout backgroundColor="yellow">
                    <Label text="Box 1" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="red">
                    <Label text="Box 2" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="blue">
                    <Label text="Box 3" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="green">
                    <Label text="Box 4" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="purple">
                    <Label text="Box 5" padding="70" />
                </StackLayout>
                <StackLayout backgroundColor="orange">
                    <Label text="Box 6" padding="70" />
                </StackLayout>
            </StackLayout>
        </ScrollView>
        <Label text="Try to scroll the colored boxes above to the right and left to reveal more boxes.  You shouldn't be able to."
            padding="10" textWrap="true" fontSize="20" />
        <Label text="On Android with run time version 4.2.0 you can't, but on run time version 5.0.0 you can."
            padding="10" textWrap="true" fontSize="20" />
    </StackLayout>
</Page>


isUserInteractionEnabled
设置为
false
时禁用滚动-这似乎是{N}5.x中引入的行为变化。同时,我不确定这是否是故意的,你们可能想在Github上报告


同时,您也可以使用此功能。

在启用回滚时进行了修复-记录了一个问题-感谢您记录此问题。仅供参考,我在scrollview上禁用滚动的原因是,如果我将滚动嵌套在多个接受手势的对象中(例如,具有垂直和水平滚动视图的选项卡视图),并且我希望在代码中处理滚动(例如,按钮而不是滑动)。