views:

486

answers:

3

here is the problem! I have a UIWebView in my programs that loads a php page. The problem is that if the page has a lot of lines i cannot see them. I can "scroll" the UIWebView but when I leave the finger from the screen the page comes back to the original state. I don't want to scale pages to fit the view cause if I do that the letters become too small. I would like to find a way to scroll pages how it is possible in Safari. Hope i have explained the problem. Thank you in advance Antonio

A: 

you can always use

UIWebView *wv = [controller webbrowser];
[wv loadHTMLString:pageUrlToLoad baseURL:nil];

wv.scalesPageToFit = YES;

It does the trick for me. it will try to fit the entire page in the window.


ADD ON:

write UIWebView in XCode window and pressing the ALT key, double click on it.

it will show the Fast Help window, there you can find projects using that View

  • click on UI Catalog and when it opens, click the button Open with XCode
  • select the folder you want to have all the project files and go
  • select the iPhone Simulator 3.1.3 as the target device and Run the app.

You will get a lot of User Interfaces and all the code they use is right there so you can copy/paste and change to your own way.

give it a shoot!

balexandre
+1  A: 

If you have control of the web page, it is easier to control the UIWebView with http than programmatically.

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
drawnonward