Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> JavaScript

Làm iOS UIWebView hiển thị website mobile đúng cách


Để hiển thị website mobile đúng, thử fix:

mywebview.scalesPageToFit = YES; mywebview.contentMode = UIViewContentModeScaleAspectFit;

Cũng có thể đặt:

NSString *js = [NSString stringWithFormat:@"document.body.style.zoom = 0.8;"]; [webView stringByEvaluatingJavaScriptFromString:js];