Appcelerator ScrollView 与图像 url
又一个问题:
我有一个滚动视图,其中图像由 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
});
再次感谢您的帮助。
萨沙
again another question:
I have a scrollView where the images loaded by createView, but how can i add an image from an url? In my case if i change ../images/.... to http://www.codeworxx.com/images/... the images are not loading. In coverFlowView it works?!?!
Any ideas? Here's my code:
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
});
Thanks again for your help.
Sascha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不将 Titanium.UI.ImageView 添加到滚动视图中。
这里有一个很好的滚动图像示例。
http://shakilspace.blogspot.com/2011/02/appcelerator -titanium-scrollview-swipe.html
还有一个钛Codecanyon 上提供的滚动图像示例 应用程序
http://codecanyon.net/item/swipeable-photo-gallery/145864
Why don't you add Titanium.UI.ImageView to the scrollview.
There is a good example here of scrolling images.
http://shakilspace.blogspot.com/2011/02/appcelerator-titanium-scrollview-swipe.html
There is also a Titanium scrolling image example app available on Codecanyon
http://codecanyon.net/item/swipeable-photo-gallery/145864