简体   繁体   中英

How to display UIWebView content at the center of my view?

I have an UIWebview which taking all the place in my View. My content are in the top but I don't change the code of my UIWebview content and I would like to display my UIWebview at the center of my view (in position 2) for all the device (IOS6/IOS7), how can I do that with the good parameter or manipulation in my UIWebview ?

I work with xib file. I don't use AutoLayout for my view.

我的情况其实

Thanks for advance

You can do it programattically as...

CGRect viewrect = view.bounds.

webview.center = CGPointMake(viewrect.size.width/2,viewrect.size.height/2);

Try it out.

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