iphone - UIWebView in UINavigationController not scrolling -
I have an application that is basically a tabbar where tabs are the UI navigation controllers that have separate ViewControllers with UIWebViews Move forward and forward between My problem is that although I can click for the button of UIWebViews, then I can not scroll content when it is larger than the screen.
Creating TabController
tabbar controller = [[Main tab controller allocation] Init]; [Tabbar controller set output: self]; When switching between tabs, I have this code:
WebViewController * wvc = [[WebViewController alloc] initWithNibName: @ "WebCentroler" bundle : Zero] ; UIWebView * wv = [[UIWebView alloc] init]; [Wv setUserInteractionEnabled: Yes]; [Wvc setTitle: [nc title]]; [VV set Deliegate: Self]; [Wv loadRequest: [NSRR request request with url: [ns url URLWithString: requestURL]]]; [Wvc setWebpage: wv]; [VVC Setview: VV]; [Nc push viewcontroller: wvc animated: no]; NSLog (@ "NC.viewControlroll count:% d", [nc.viewControllers count]); [NC SettleRust: requestURL]; [Wvc startLoaderIndicator]; [VV Release]; [VVC release]; Oak = yes; And when a link is clicked within one of UIWebViews, then I have it:
ItemNavigationController * nc = (ItemNavigationController *) [Tabbed controller selected ViewController]; WebViewController * wvc = [[WebViewController alloc] initWithNibName: @ "WebControler" bundle: zero]; UIWebView * wv = [[UIWebView alloc] initWithFrame: CGRectMake (0,0,320,480)]; //wvc.view = wvc.sView; [Wvc setTitle: [nc title]]; [VV set Deliegate: Self]; [Wv loaderview: request]; [Wvc setWebpage: wv]; [VVC Setview: VV]; [Nc push viewcontroller: wvc animated: no]; NSLog (@ "NC.viewControlroll count:% d", [nc.viewControllers count]); [Nc setllight url: request.URL.absoluteString]; [Wvc startLoaderIndicator]; [VV Release]; [VVC release]; Oak = yes; Everything works perfectly, except that the webvig does not scroll. Something looks like this:
first Thing I do not like in this code block ...
WebViewController * wvc = [[WebViewController alloc] initWithNibName: @ "WebControler" bundle: zero]; UIWebView * wv = [[UIWebView alloc] initWithFrame: CGRectMake (0,0,320,480)]; Wvc.view = wvc.sView; To view view controller instead, create sub-view in the viewDidLoad block and add it. Also, benefit yourself from IB and through XIB Connecting WebView to and connect with just IBotlotte and Rep. If you insist on doing this, do not overwrite this view,
[wvc.view addSubview: wv]; I wrote it in a simple WebViewController:
- (zero) viewDidoadload {[Super Viewedload]; Self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight; UIWebView * webView = [[UIWebView alloc] initWithFrame: self.view.bounds]; WebView.autoresizingMask = UIViewAutoresizingFlexibleHeight; [Self.view addSubview: webView]; [WebWorldLauderWest: [NSRR request request with url: [NSUr URL youththring: @ "http://news.google.com"]]]; } And it has been called from an AppDelegate like this:
- (BOOL) Application: (UIApplication *) Application FinishLaunchingWithOptions: ( NSDictionary *) launchOptions {Self.window = [[UIWindow alloc] initWithFrame: [[UIScreen main screen] border]] autorelease]; Self.window.backgroundColor = [UIColor whiteColor]; CPWebController * WebConverter = [[CPWebController alloc] init]; CPNavController * navController = [[CPNavController alloc] initWithRootViewController: webController]; [Self. Add Window Add: NewView: navController.view]; [Self. Windows and knowledgeable]; Yes come back } This is a size, a navbar, and scrolls correctly, sorry for the lack of release for code summaries.
Comments
Post a Comment