繁体   English   中英

Titanium ScrollView不会从左向右滚动

[英]Titanium ScrollView does not scroll left to right

我正在使用Titanium构建应用程序。 好吧,我们想要滚动视图从左向右滚动,反之亦然。

    <ScrollView id="svForm" backgroundColor="green" top="10" width="100%" height="200"
        scrollType = "horizontal" layout="horizontal" >

            <View width="23%" height="90%" top="0" borderColor="#FFFFFF" borderWidth="1" backgroundColor="brown">
                <Label>
                    1 
                </Label>
            </View>
            <View width="23%" height="90%" top="0" borderColor="#FFFFFF" borderWidth="1" backgroundColor="orange">
                <Label>
                    2 
                </Label>
            </View>
            <View width="23%" height="90%" top="0" borderColor="#FFFFFF" borderWidth="1" backgroundColor="yellow">
                <Label>
                    3
                </Label>
            </View>
            <View width="50%" height="90%" top="0" borderColor="#FFFFFF" borderWidth="1" backgroundColor="blue">
                <Label>
                    4
                </Label>
            </View>

    </ScrollView>

但它没有那样做。 最后一个视图(因为它不再适合)下降。 我该如何实现这一权利? 是否设置了所有视图需要并排放置的设置? 我也试图把它放在一个视图上,但仍然无法工作。

我们将不胜感激。 谢谢!

这对我有用:

<ScrollView id="svImage" height="Ti.UI.SIZE" width="Ti.UI.FILL" scrollType = "horizontal" layout="horizontal"></ScrollView>

在合金xml文件中使用它,并使用add方法从合金xml或js文件添加视图。

我添加了scrollview属性

<ScrollView id="svForm" backgroundColor="green" top="10" height="200"
scrollType = "horizontal" 
contentWidth =  'auto'
contentHeight = 'auto'
showVerticalScrollIndicator = "true"
showHorizontalScrollIndicator = "true">

它现在工作正常。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM