Appcelerator ScrollView 与图像 url

发布于 2024-10-19 22:41:04 字数 1160 浏览 1 评论 0原文

又一个问题:

我有一个滚动视图,其中图像由 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老街孤人 2024-10-26 22:41:04

为什么不将 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文