IPad scrollable imageview from masterview table
I have a large number of fullscreen images I want to display on the iPad (I debated a coverflow view, but I'd rather have them fullscreen). The image url is being pulled from a folder url listed on the masterview table, as well as a total for number of images and dir which is also the window title. The current nonworking code is
var dir = p.rowData.Title;
var photodata = [];
var x = 0;
var imagetotal = p.rowData.total - 1;
for (var c=0;c<imagetotal;c++)
{
photodata[c] = p.rowData.url+c+'.jpg';
};
var photoscroll = Ti.UI.createScrollableView({views:photodata});
var photowin = Ti.UI.createWindow({
barColor:'#5f6062',
title:dir,
backgroundColor:'#fff'}
);
photowin.add(photoscroll);
Main.detailNav.open(photowin,{animated:true});
The images are all 1024x768 and I'd like to hide the titlebar (tap to show) so the user can see the entire photo and scroll for more. I'd also like to force a landscape orientation and haven't found anything that works. Anyone having something like this working and can share code?
Cheers
1 Answer
-
I've continued to work on this and am at:
var dir = p.rowData.title; var photodata = []; var imagetotal = p.rowData.total - 1; var photoimage = p.rowData.url; for (var c=0;c<imagetotal;c++) { photodata[c] = Titanium.UI.createImageView({image:photoimage+c+'.jpg',backgroundColor:'#000',height:'auto',width:'auto'}); } var photoscroll = Ti.UI.createScrollableView({views:photodata}); var photowin = Ti.UI.createWindow({ barColor:'#5f6062', title:dir, backgroundColor:'#000'} ); photowin.add(photoscroll); Main.detailNav.open(photowin,{animated:true});
This is now giving me a "Failed to load image" error, even though it is correctly pointing to the App://Resources.. file.