Photoswipe rotation issue when in ios4 UIWebView -


i using photoswipe 3.0.5 in ios application. working correctly in simulator (ios 6.1), when run app on real device (ios4.3) , rotate portrait landscape , viceversa uiwebview correctly rotates image doesn't.

it seems common issue, infact photoswipe's github page(https://github.com/codecomputerlove/photoswipe) says:

work around issue #141 officially added - when rotating app photoswipe displayed in uiwebview, photoswipe not rotate. seems issue uiwebview not photoswipe. enable work around, set "enableuiwebviewrepositiontimeout = true" when creating photoswipe instance. can specify frequency of timeout setting "uiwebviewresetpositiondelay" (default 500ms) - please note not needed phonegap apps, nor web apps added homescreen.

but don't know add line of code. can give me hand?

would 'work around' trick? i'm asking question because working correctly on simulator.

i found answer. need add 'enableuiwebviewrepositiontimeout: true' 'options' var:

    (function(window, photoswipe){          document.addeventlistener('domcontentloaded', function(){              var                 options = {                     enableuiwebviewrepositiontimeout: true,                     preventhide: true,                     getimagesource: function(obj){                         return obj.url;                     },                     getimagecaption: function(obj){                         return obj.caption;                     }                 },                 instance = photoswipe.attach(                      [                         ...                      ],                      options                  );                  instance.show(0);          }, false);       }(window, window.code.photoswipe)); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -