简体   繁体   中英

finding image position in landscape and portrait in UIWebView when orientation changes

I have a UIWebView which loads images on it. Obviously on portrait the image will have a different origin x and y point and width and height comparing to the landscape. Question is how do I find this origin x and y when orientation changes? Do I have to inject a js function that finds this number everytime the orientation change or is there an easier way?

If you center your image inside of the UIWebView , then make the UIWebView auto-resize so it takes the full available width, you have no need to use JS to know how large the image is.

I don't know if this suggestion applies to your specific case, I hope it does. Otherwise, please provide more details.

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