【发布时间】:2014-07-02 08:00:38
【问题描述】:
我是使用 Titanium 的新手。我试图将一些图像加载到滚动视图中。但只有一张图像加载到滚动视图区域。代码在这里
XML
<Alloy>
<Window class="container">
<ScrollView showHorizontalScrollIndicator="true" id="Scroll" layout="horizontal">
</ScrollView>
</Window>
</Alloy>
JS
var scrollView = $.Scroll;
var URLs = ["http://static.flickr.com/41/81743961_588dafe12d_o_d.jpg", "http://static.flickr.com/26/64914466_eed02e2a71_o_d.jpg"];
var Views = [];
for (i =0; i < URLs.length ; i++){
Views.push(Ti.UI.createImageView({
image : URLs[i],
width : Ti.UI.SIZE,
height : 300,
top : 0,
left : 0,
})
);
}
Views.forEach(function(view){
scrollView.add(view);
});
$.index.open();
TSS
".container": {
backgroundColor:"white"
},
"#Scroll":{
width:Ti.UI.SIZE,
top: 50,
}
截图
我需要你的帮助来找出我的错误。
谢谢
【问题讨论】:
标签: imageview scrollview titanium-alloy