Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1369] iOS: Images in scrollview gets jambled up in landscape

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionInvalid
Resolution Date2017-06-14T17:30:26.000+0000
Affected Version/sRelease 1.5.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterChris G
AssigneeIngo Muschenetz
Created2011-04-15T02:50:35.000+0000
Updated2017-06-14T17:30:26.000+0000

Description

I got a small scrollview in portrait inside a scollerview, which works okay (stops accepting vertial scroll if only one image is there). Then when u turn the phone sideways, a second window opens with a landscape imageview, this worked in 1.3 but now it goes crazy monkey and every thing is jumbled up


    Ti.Gesture.addEventListener('orientationchange',function(e)
    {   //Titanium.UI.orientation = e.orientation;
        if(e.orientation == Titanium.UI.LANDSCAPE_LEFT || e.orientation == Titanium.UI.LANDSCAPE_RIGHT)
        {   
            (function(photo_array)
            {   var gallery_win = Titanium.UI.createWindow({
                    url:'gallery.js',
                    backgroundColor:'#000000',
                    fullscreen: true,
                    orientationModes: [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT]
                });
                gallery_win.photo_array = photo_array;  
                gallery_win.open();
                
            })(photo_array);
        }
     
    });

//gallery.js
var win = Titanium.UI.currentWindow;

var image_scrollView = Titanium.UI.createScrollableView({views:win.photo_array, maxZoomScale:2.0, fullscreen:true, height: 'auto', width:  'auto' });
win.add(image_scrollView);

Ti.Gesture.addEventListener('orientationchange',function(e){
    if(e.orientation == Titanium.UI.PORTRAIT)
    {   win.close();
    }
});

Attachments

FileDateSize
img_02201.PNG2011-04-15T02:50:35.000+0000193662

Comments

  1. Chris G 2011-04-15

    Happens in iphone, using 1.3.2, 1.3.2 and latest git

  2. Chris G 2011-04-15

    Well, this sort of fixed it, but still the touch event is a bit messed up, have to touch in the middle to scroll.

         Ti.Gesture.addEventListener('orientationchange',function(e)
           {   //Titanium.UI.orientation = e.orientation;
               if(e.orientation == Titanium.UI.LANDSCAPE_LEFT || e.orientation == Titanium.UI.LANDSCAPE_RIGHT)
               {   
                   (function(photo_array)
                   {   
                       var gallery_win = Titanium.UI.createWindow({
                           fullscreen: true,
                           orientationModes: [e.orientation],
                           backgroundColor: '#000000'
                       });
       
                       gallery_win.add(Titanium.UI.createScrollableView({fullscreen: true,top:0,left:0,width:480,height:320,views:photo_array,backgroundColor: '#000000'}));
                       
                       Ti.Gesture.addEventListener('orientationchange',function(e)
                       {   if(e.orientation == Titanium.UI.PORTRAIT)
                           {   gallery_win.close();
                               image_scrollView.currentPage = 0;
                           }
                       });
                       gallery_win.open();
                       
                   })(photo_array);
               }
            
           });
       
  3. Stephen Tramer 2011-04-15

    Probably invalid, but the ticket is vague enough to be both plausible and require some R&D.

  4. Lee Morris 2017-06-14

    Closing due to time passed and lack of progress since the ticket was opened in April 2011.

JSON Source