简体   繁体   中英

UIWebView Rotation and Background Color

I've run into an interesting situation with a UIWebView. In Interface Builder, I set all four constraints to equal the margins and filled the webview with content. It works exactly as you'd expect.

An issue occurs when I rotate the webview. The webview rotates but in doing so, it reveals an grey background color. This isn't a color that I've set. In fact, I set the parent's view to have a black background color to match the webview content.

在此处输入图片说明

Here are my constraints for reference:

在此处输入图片说明

I'd appreciate any guidance on how to make my webview will the entire border or at least, manually change the grey color. Much thanks!

Note: This only occurs in the simulator. I haven't tried this on a device yet.

Ack ... it was the background view that was the culprit. The simulator didn't pick up my color changes. I never did a clean on them. I tested today and was able to change the grey color to the one of my choosing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM