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!

Accepted Reply

Looks fixed in iOS10.2b1! I'll keep testing to confirm.

Replies

Maybe related?



http://stackoverflow.com/questions/37808180/disable-viewport-zooming-ios-10-safari



"From the iOS 10 beta 1 release notes:

To improve accessibility on websites in Safari, users can now pinch-to-zoom even when a website sets user-scalable=no in the viewport."

Still broken in iOS10b3.

Note:

In the Safari inspector, with the same code/project running in the simulator, the iPhone is modified correctly ("-webkit-text-size-adjust: 220%;"), but not on iPad ("-webkit-text-size-adjust: auto;").

I have the exact same experience, and it's still persistant with beta4. Works on ios9 phone/pad and ios10 phone, but ios10 pad ignores the text size adjustment

Anyone filed Radar bug report? Thx.

I filled an Apple radar #27201529.


But please create a new radar and link to this one!


Thanks!

Still broken in iOS10b5.

Still broken in iOS10b7.

Still broken in iOS10b8.

Still an issue with the GM release 😟

I've tried using both UIWebView and WKWebView, and it doesn't react to the webkitTextSizeAdjust.

Anyone found a work around? Besides setting text size to a specific size...

Us too. Was hoping Apple would fix this before they release it to the world. Our app heavily relies on it.

Still broken in iOS10GM.

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

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

same problem only on iPAD, iphone is ok.


I think Apple will fix it!