iceduck
iceduck

Reputation: 163

DIsplay a UIwebview on iPad AND iPhone

I'm trying to build an application for both iPad and iPhone. My webview is working on iPhone but when I run it on iPad, the webview is still small. Is there a way to dynamically set the size of the website depending on the size of the screen, or any other workaround to have a webview work on both iPhone and iPad?

Any help would be appreciated.

I finally solved the problem by having 2 webviews with respective sizes of the iPad and iPhone. Detecting the device and then loading the appropriated view. I also had to setup a 20px y offset because my view was not scaled with the statusbar. So I also reduced the height of the frames by 20px. The application should be downloadable on the iTunes store as soon as they approve it. You can check it out on the Android Market though : https://market.android.com/details?id=webmy.me.douchebagjar

I can post the code if anybody is facing the problem. Thanks for the answers.

Upvotes: 0

Views: 2079

Answers (1)

sch
sch

Reputation: 27506

You can set the frame of the view to the size of the screen:

webView.frame = [[UIScreen mainScreen] bounds];

Upvotes: 3

Related Questions