Appcelerator 左图
我正在尝试使用 Appcelerator 制作我的第一个移动应用程序。当我尝试使用“leftImage”将本地图像加载到数组中时,图像不显示。但是,当我将路径更改为不存在的路径时,它告诉我它找不到路径。我用谷歌搜索了很多,似乎找不到我做错了什么。有什么帮助吗?
var win1 = Titanium.UI.createWindow(
{
title:'test',
className:'win1',
backgroundColor:'#000000'
}
);
var vdata = [
{leftImage:'appicons/cloudy.gif',title:"Schedule"},
{leftImage:'appicons/shows.png',height:60, title:"Shows"},
{leftImage:'appicons/search.png', title:"Search"},
{leftImage:'appicons/friends.png',title:"Friends"},
{leftImage:'appicons/settings.png',title:"Settings"}
];
var table1 = Titanium.UI.createTableView({
data:vdata
});
win1.add(table1);
win1.open();
I'm trying to make my first mobile app using Appcelerator. When i try to load a local image into the array using "leftImage", the image doesn't show. However when i change the path to something that doesn't exist it tells me it can't find the path. I've googled it a lot and can't seem to find what i did wrong. Any help please?
var win1 = Titanium.UI.createWindow(
{
title:'test',
className:'win1',
backgroundColor:'#000000'
}
);
var vdata = [
{leftImage:'appicons/cloudy.gif',title:"Schedule"},
{leftImage:'appicons/shows.png',height:60, title:"Shows"},
{leftImage:'appicons/search.png', title:"Search"},
{leftImage:'appicons/friends.png',title:"Friends"},
{leftImage:'appicons/settings.png',title:"Settings"}
];
var table1 = Titanium.UI.createTableView({
data:vdata
});
win1.add(table1);
win1.open();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
leftImage 是 Titanium.UI.TableViewRow 的属性
所以,你应该使用这个:
leftImage is the property of Titanium.UI.TableViewRow
So, you should use this:
键入此代码
您还可以参考
http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.TableViewRow-property-leftImage
Ty this code
You can also refer
http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.TableViewRow-property-leftImage
不要使用 leftImage 作为数据的属性,而是将 leftImage 属性与
Ti.UI.createtableViewRow
一起使用。方法一:
方法二:
Instead of using leftImage as a property of data, use leftImage property with
Ti.UI.createtableViewRow
.method 1:
method 2: