2015-02-09 130 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

相關問題