Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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

— asked July 11th 2010 by Troy Taylor
  • imageview
  • ipad
  • landscape
  • scrollable
0 Comments

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.

    — answered July 21st 2010 by Troy Taylor
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.