jeudi 26 mars 2015

web app UIWebView not resizing after changing orientation to landscape

i'm coding an iphone app in which i have a uiwebview that loads a website with a responsive design, the problem i have is when i rotate the devices to landscap,


the uiwebview rotates but it keeps the same width as the portrait mode, i spent the last 5 hours searching all over the net, i found some solutions that i used but wihtout success,


the responsive website is http://ift.tt/1BtdQv9


the AboutViewController for loading the responsive web url:



- (void)viewDidLoad
{
[super viewDidLoad];
NSString *urlString = nil;
NSString *languageCode = [[NSLocale preferredLanguages] objectAtIndex:0];
if ([languageCode isEqualToString:@"zh-Hans"]) {
urlString = @"http://ift.tt/1EYuczg";
}if ([languageCode isEqualToString:@"zh-Hant"]) {
urlString = @"http://ift.tt/1EYuczg";
}else{
urlString = @"http://ift.tt/1E5ClEu";
}
NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];

NSURLRequest *urlrequest = [NSURLRequest requestWithURL:url];

[_About loadRequest:urlrequest];


}


i also checked the "Scale Page to Fit" checkbox, I'm using Xcode 6 and the app is universal and can rotate orientation


enter image description here


enter image description here




Aucun commentaire:

Enregistrer un commentaire