TableView leftImage parameter can't be a URL ?
Hi
I am trying to create a tableView that has a left Image, when I use local image files it works fine.
when I use URLs the image does not display at all on the iPhone simulator but works well on the Android simulator…
what am I doing wrong ?
var RegData = [
{ leftImage:'../images/fonebook/phone_icon.png', title:"Spain", hasChild:true },
{ leftImage:'../images/fonebook/phone_icon.png', title:"United Kingdom", hasChild:true },
{ leftImage:'../images/fonebook/phone_icon.png', title:"United States", hasChild:true },
{ leftImage:'../images/fonebook/phone_icon.png', title:"France", hasChild:true }
];
var TheTable = Titanium.UI.createTableView({
data:RegData
});
win.add(TheTable);
var RegData = [
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"Spain", hasChild:true },
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"United Kingdom", hasChild:true },
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"United States", hasChild:true },
{ leftImage:'http://devimages.apple.com/assets/elements/icons/32x32/video.png', title:"France", hasChild:true }
];
var TheTable = Titanium.UI.createTableView({
data:RegData
});
win.add(TheTable);
4 Answers
-
I think this is a known issue, but I can't make any sense of the ticket that has been opened
-
I don't think it is the same issue. Mine is leftImage which should be supported.
-
Hi Moshe,
i just ran into the same problem that you describe (thus i can confirm it exists ;) and found a solution for it: if you create your TableViewRows yourself, adding an ImageView object to each row, your self-created "leftImage"s can have remote urls.
you can find a blogpost about that at http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/ which is mostly correct and was a good starting point for me to dig deeper.
HTH
pekue -
that solution worked perfectly until i upgraded to the latest mobile SDK (1.7) and now i get the error:
[WARN] Creating [object TiUITableViewRow] in a different context than the calling function.
[WARN] (null)->(null) [0]->[object UIModule] is being made in a thread not owned by <KrollContext: 0x6a71000>and the image doesn't display.
anybody run into this?