4

我在 android 的 app.js 文件中有这段代码,在我的资源中有一个 images 文件夹:

var win = Titanium.UI.createWindow({

    title : "my Name is Reyjohn",
    backgroundColor : "#FFFFFF",

    exitOnClose : true

})


var img = Titanium.UI.createImageView({


    image:"images/Hypedin.png",
    height:20,
    width:30


});


win.add(img);

win.open();

但它没有在背景中显示任何图像,我在哪里做错了?我是钛新手,请帮忙

4

2 回答 2

6

尝试将另一个 / 添加到路径中,例如:

image:"/images/Hypedin.png",

您也可以尝试设置正确的 Positioning:

top: 0,
left: 0

你检查过日志/输出吗?有错误吗?

于 2012-05-15T15:20:21.770 回答
1

你的代码没有错。检查并确保images/Hypedin.png那里有正确的拼写。可能是笔误。

于 2012-05-15T02:15:33.087 回答