TableView leftImage parameter can't be a URL ?

You must Login before you can answer or comment on any questions.

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 don't think it is the same issue. Mine is leftImage which should be supported.

— answered 3 years ago by Moshe Marciano
answer permalink
1 Comment
  • yes it "should" be supported, but it doesn't work... what I am suggesting is that sounds unbelievably similar so you might want to investigate if it is in fact a known bug... I tested the code above and it fails... none of the kitchen sink examples use remote urls for leftImages either.

    — commented 3 years ago by Aaron Saunders

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?

Your Answer

Think you can help? Login to answer this question!