J'ai reçu une réponse d'Apple à propos du bogue possible rapporté, ils ont demandé un exemple de code qui peut reproduire le problème, je leur ai envoyé et im le poster ici, donc vous peut tester aussi:
//
// viewController.m
// TesteWebview
//
// Created by GecanMobile01 on 13/11/09.
// Copyright xxx All rights reserved.
//
#import "viewController.h"
@implementation viewController
@synthesize vw, wv;
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
}
return self;
}
*/
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
vw = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
[vw setBackgroundColor:[UIColor grayColor]];
vw.autoresizesSubviews = YES;
self.view = vw;
wv = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
[self.view addSubview:wv];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
NSURL *urlId = [NSURL URLWithString:@"https://www.google.com"];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:urlId cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:(NSTimeInterval)10.0];
[wv loadRequest:theRequest];
[super viewDidLoad];
}
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
CGRect cgrWebView;
BOOL bChangeOrientation = NO;
if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight){
if (interfaceOrientation == UIInterfaceOrientationPortrait) {
cgrWebView = CGRectMake(0.0, 0.0, 320.0, 460.0);
bChangeOrientation = YES;
} else {
cgrWebView = CGRectMake(0.0, 0.0, 480.0, 320.0);
bChangeOrientation = YES;
}
[wv setFrame:cgrWebView];
}
return bChangeOrientation;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
Cela fonctionne! Merci. –