简体   繁体   English

在Titanium Appcelerator中显示来自ios模块的图像

[英]Show an image from ios module in titanium appcelerator

I am able to understand the concept of View a little bit in titanium. 我能够稍微了解一下钛的“视图”的概念。 But i donot understand how image can be wrap up as an object in titanium module and send it as an object. 但是我不明白如何将图像包装为钛模块中的对象并将其作为对象发送。 I just want to show a simple image in titanium which i took from server in ios module. 我只想显示一个钛金属的简单图像,该图像是我从ios模块中的服务器获取的。

Thank you for your help 谢谢您的帮助

If I understand your question correctly, you need to simply create an ImageView which is an object. 如果我正确理解了您的问题,则只需创建一个ImageView对象即可。 That object will hold the image data. 该对象将保存图像数据。

Then to display the image, just add it to whatever view is on your screen: 然后要显示图像,只需将其添加到屏幕上的任何视图即可:

var image = Ti.UI.createImageView({
    image:'http://www.someserver.com/yourimageurl.jpg',
    width: 100,
    height: 100,
    top:0,
    hires: true
});

YourView.add(image);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM