iOS 10: UIWebView: can't change text size on iPad

In our production app, we can't seem to be able to change the text size of a UIWebView on iOS 10 on iPad.



We're using this method to change the text size:

[self.webview stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust = '%d%%'", size]];



Running our sample project, always running on iPad simulator with iOS 10:

(always running in iPad simulator, but switching Deployment device setting)

-On iOS9, built for iPhone device: works

-On iOS9, built for iPad device: works

-On iOS10, built for iPhone device: works

-On iOS10, built for iPad device: DOESN'T WORK, no resizing, no errors or warnings



We are aware of WKWebView, and there are similar issues, using similar methods, except that it doesn't work for both iPad and iPhone on iOS10, but works on iOS9.



Using Xcode 8 beta 2, on iPad simulator with iOS 10 beta 2 (also tried with iOS 10 beta 1).


(Update: still broken in iOS10 GM and iOS10.1b1)


Anyone have any ideas or alternatives?

Thanks!

Please report a Radar to Apple and refer to this thread and Radar #27201529, thanks!

In case it helps, I found that using fontSize instead of webkitTextSizeAdjust works for iPad with iOS10, at least on the simulator. e.g.:


document.getElementsByTagName('body')[0].style.fontSize='166%';

We had tried this, but doesn't work as expected in our case, with text of different font types/sizes, like it did webkitTextSizeAdjust.

But thanks anyways!

only ios 10 workaround would be to use css zoom: instead of -webkit-text-size-adjust:


be careful though. It messes a lot of stuff up!

Thanks for the info! We're already looking into "zoom" as our current plan B, but we have to make a lot of changes to compensate, like JavaScript click detection. We're still hoping they'll fix "-webkit-text-size-adjust" in the next iOS10 minor update.

Still broken in iOS10.1b1.

Hi! Same problem here. Font adjusting is broken in my epub reader.

Darn its so frustraiting when you work really hard on an app trying to make it perfect and then one bug in the SDK breaks it and you can't do anything about it. And users are mad at you not at Apple. And Apple just completely ignores it as always. F***

Not the first time not the last.

From ddkilzer (thanks!):


This bug tracks the fix in open source WebKit:

REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad

https://bugs.webkit.org/show_bug.cgi?id=162227

(seems RESOLVED FIXED)


Looks like there's hope that this will be fixed in iOS.

Thanks Apple and Daniel Bates!

Any idea when will Apple iOS send out new release with following patch?

REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad

https://bugs.webkit.org/show_bug.cgi?id=162227

No idea, no update on the related Radar yet.

Not yet included in iOS10.1b1 or iOS 10.0.2.

Still broken in iOS 10.1b2.

Any news about this bug?
We can't fix thid problem, only apple can do it, but how long ??

We are encountering the same problem with our app. We would really appreciate a response as our users are starting to complain.

Still broken in iOS10.1b3.

Still broken in iOS10.1b4.

iOS 10: UIWebView: can't change text size on iPad
 
 
Q