2015-02-09 72 views
2

我有一个滚动视图,其内容高度为auto
并且在其中我有一个包含所有UI元素的视图我使用
但我的问题是,当我的视线的高度设置为Ti.UI.SIZE将子视图的高度设置为Ti.UI.SIZE Titanium时滚动视图不滚动

滚动视图不滚动它只是滚动的情况下,我加入一个固定数目如2000年至子视图高度

下面是代码

var scrollView = Ti.UI.createScrollView({ 
    contentWidth : 'auto', 
    contentHeight : 'auto', 
    backgroundColor : '#fff', 
    showVerticalScrollIndicator : false, 
    showHorizontalScrollIndicator : false, 
    height : "100%", 
    width : "100%", 
    top : 36.6 
}); 

var view = Ti.UI.createView({ 
    backgroundColor : '#fff', 
    borderRadius : 0, 
    height :Ti.UI.SIZE, 
    width : Ti.UI.FILL 
}); 

我不会在视图底部的任何额外的空间,所以我怎么能做到这一点,并在此先感谢

+0

您在**视图**中添加了其他任何内容吗? – turtle 2015-02-10 05:41:51

+0

是的,我添加了标签,slider和amd textfeild – Tony 2015-02-10 09:27:26

+0

你可以粘贴整个代码,因为scrollview只会在数据(如视图,标签等)溢出屏幕时才滚动。 – turtle 2015-02-10 11:59:08

回答

3

我有固定我的问题与此

var padding_view = Ti.UI.createView({ 
    backgroundColor : "transparent", 
    top : "36.6dp", 
    left : "11dp", 
    right : "11dp", 
    bottom:"0dp", 
}); 
var scrollView = Ti.UI.createScrollView({ 
    contentWidth : '100%', 
    contentHeight : 'auto', 
    backgroundColor : '#fff', 
    showVerticalScrollIndicator : false, 
    showHorizontalScrollIndicator : false, 
    top : "36.6dp", 
    bottom:"22dp", 
}); 

var view = Ti.UI.createView({ 
    backgroundColor : '#fff', 
    height :Ti.UI.SIZE, 
    width : Ti.UI.SIZE 
}); 
0

尝试它:

var scrollView = Ti.UI.createScrollView({ 
    contentWidth : 'auto', 
    contentHeight : 'auto', 
    backgroundColor : '#fff', 
    showVerticalScrollIndicator : false, 
    showHorizontalScrollIndicator : false, 
    height: Titanium.UI.FILL, 
    width : "100%", 
    top : 36.6 
}); 

var view = Ti.UI.createView({ 
    backgroundColor : '#fff', 
    borderRadius : 0, 
    height :Ti.UI.SIZE, 
    width : Ti.UI.FILL 
}); 
+0

请格式化您的答案 – 2015-02-09 14:09:25

+0

谢谢男人,但它不工作:( – Tony 2015-02-09 14:10:45

+0

可以发送XML文件也 – VRK 2015-02-09 14:12:40

相关问题