Appcelerator ScrollView带有图片网址

时间:2011-03-02 13:27:54

标签: iphone titanium appcelerator appcelerator-mobile

又一个问题:

我有一个scrollView,其中由createView加载图像,但我如何从网址添加图像?在我的情况下如果我改变../ images / ....到http://www.codeworxx.com/images/ ...图像没有加载。在coverFlowView中,它有效吗?!?!

有什么想法吗?这是我的代码:

var image1      = Ti.UI.createView({width:320,height:156,backgroundImage:'../images/gallery/bmw3er/image1.jpg'});
var image2      = Ti.UI.createView({width:320,height:156,backgroundImage:'../images/gallery/bmw3er/image2.jpg'});
var image3      = Ti.UI.createView({width:320,height:156,backgroundImage:'../images/image3.jpg'});
var image4      = Ti.UI.createView({width:320,height:156,backgroundImage:'../images/image4.jpg'});
var image5      = Ti.UI.createView({width:320,height:156,backgroundImage:'../images/image5.jpg'});
var image6      = Ti.UI.createView({width:320,height:156,backgroundImage:'../images/image6.jpg'});

var scrollView = Ti.UI.createScrollableView({
    views:[image1,image2,image3,image4,image5,image6],
    showPagingControl:true,
    clipViews:false,
    top:0,
    left:30,
    right:30,
    width:320,
    height:156,
    opacity:0
});

再次感谢您的帮助。

的Sascha

1 个答案:

答案 0 :(得分:1)

为什么不将Titanium.UI.ImageView添加到scrollview。

滚动图像有一个很好的例子herehttp://shakilspace.blogspot.com/2011/02/appcelerator-titanium-scrollview-swipe.html

Codecanyon上还有一个Titanium scrolling image example应用程序 http://codecanyon.net/item/swipeable-photo-gallery/145864