Monday, June 27, 2011

Fighting with UIWebViews

Last week we wrote a 2-page paper about Access Lecture to try and get our poster accepted for the 2011 ASSETS conference in Dundee, Scotland. We always thought writing one of those long research papers would be difficult, but we found that our initial draft was almost 5 pages long. It turns out that it's really difficult to write about everything we've done when there's a limit of only 2 pages!  ASSETS is a conference specifically dealing with accessibility and assistive technology so we're really crossing our fingers and hoping we get accepted.

After finishing the paper we decided to try making our zooming work with the UIWebView we were using to display the notes. We quickly learned that we needed to inject javascript into the website in order to enable increased levels of zooming.  For pinching to zoom this worked fine, but when we tried using our code to programatically zoom via buttons, we encountered some problems.

When we were working with a UIImageView we were able to easily calculate the center point of the view and zoom in on that point. For some reason even though we are again calculating the centerpoint, the UIWebView only zooms in on the top left of the screen..additionally that are many quirky bugs that we didn't experience when working with UIImageViews.

We've posted on Stack Overflow and a couple of IOS development forums but so far we haven't received any responses.  We think that we lack an understanding of the connection between the UIWebView and the UIScrollView that's built in; however, we haven't found any comprehensive explanations of that relationship. We're hoping that we can learn more about how they work together so that we can understand what's different about the two scrollviews. Right now the behavior of the webviews scrollview is very different than the behavior of the scrollview we previously implemented. Apple also makes it a little challenging to get access to the UIWebView's scrollview, which might mean that it's not intended for developers to manipulate it very much.  Right now, it seems like that might be the case and that we're trying to do something with the webview that we're not supposed to. In our experiences so far, Apple typically makes methods private if they don't want you to use them for apps, but the fact that they don't supply an easy way to access the scrollview could also imply that we're not supposed to be meddling with it.

~Lindsey

No comments:

Post a Comment