ImageView 不显示图像钛

ImageView not showing image Titanium

All my code (links to imgur)

为什么模拟器中没有显示图像?

所有代码,以防您不想单击上面的 link:

var win = Ti.UI.createWindow({
    backgroundColor: 'white'
});

var image = Ti.UI.createImageView({
    image: '/images/name.png',
    width:200
});

win.add(image);

win.open();

上面的link你可以看到没有拼写错误什么的

您没有为 ImageView 指定高度。

var image = Ti.UI.createImageView({
    image: '/images/name.png',
    width:200,
    height: Ti.UI.SIZE
});

如果您想让它动态化(如果您还不知道高度),请将其设置为 Ti.UI.SIZE,或者给它一个固定的高度。