Skip to content

Instantly share code, notes, and snippets.

@nek023
Created August 30, 2013 02:05
Show Gist options
  • Save nek023/6385569 to your computer and use it in GitHub Desktop.
Save nek023/6385569 to your computer and use it in GitHub Desktop.
// iPadの場合にcontentのwidthを指定してやらないとdevice-width(768 or 1024)になってしまう
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
NSString *script = [NSString stringWithFormat:@"document.querySelector('meta[name=viewport]').setAttribute('content', 'width=%d;', false); ", 320];
[webView stringByEvaluatingJavaScriptFromString:script];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment