Note that there are some explanatory texts on larger screens.

plurals
  1. POChange zoomScale and contentOffset of UIScrollView in UIApplicationStateBackground state
    primarykey
    data
    text
    <p>I know it's not recommended to change any view appearance when the application is moved to background state, but for my specific task I cannot postpone this activity and I really like to complete it in a couple of seconds after the user hits the home button.</p> <p>That's what I do: <strong>I load a webpage in a UIWebView and after loading completion I change the contentOffset and zoomScale in order to make a specific screenshot of that webpage.</strong> When the app is in active application state everything works fine.</p> <p>Now I wanted to add some more multitasking capabilities. I encapsulated the above described webpage loading and rendering activity in a <strong>protected background task</strong> (iOS Task Completion), <strong>in order to complete it even when the user hits the home button.</strong></p> <p>I have noticed that the page loading and the rendering of the webpage screenshot (with the renderInContext: method) works just fine in background, <strong>BUT it seems that the webview</strong> (i.e. the encapsulated UIScrollView instance) <strong>does not react on setContentOffset: and setZoomScale: messages as soon as the app is in background.</strong>.</p> <p>So I'm asking you if you know any alternatives to change the content offset / zoomscale? (modifications directly on CALayer?) Or any method to "force" the scrollview to perform the content changes even in background.</p> <p>PS: On the iOS simulator everything works fine even in application background state, but on real devices it does not.</p> <p><strong>EDIT: I have created a simple demo project that demonstrates the issue. You can download it here (please read the instructions in the zip file): <a href="http://dl.dropbox.com/u/3556271/BackgroundBugDemo.zip" rel="nofollow">http://dl.dropbox.com/u/3556271/BackgroundBugDemo.zip</a></strong></p> <p>I appreciate every hint or tip. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload