Category Archives: IOS

iphone sizes

iPhone 6 Plus 736×414 points 2208×1242 pixels 3x scale 1920×1080 physical pixels 401 physical ppi 5.5″
iPhone 6 667×375 points 1334×750 pixels 2x scale 1334×750 physical pixels 326 physical ppi 4.7″
iPhone 5 568×320 points 1136×640 pixels 2x scale 1136×640 physical pixels 326 physical ppi 4.0″
iPhone 4 480×320 points 960×640 pixels 2x scale 960×640 physical pixels 326 physical ppi 3.5″
iPhone 3GS 480×320 points 480×320 pixels 1x scale 480×320 physical pixels 163 physical ppi 3.5″

ios webview和native通信

  • native 调用js方法:
    NSString*returnvalue =[webView stringByEvaluatingJavaScriptFromString:@"your javascript code string here"];
  • js调用 native:
  • window.location.href = yourscheme://callfunction/parameter1/parameter2?parameter3=value

     

    -(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
       NSURL *URL =[request URL];if([[URL scheme] isEqualToString:@"yourscheme"]){// parse the rest of the URL object and execute functions
    }}

http://stackoverflow.com/questions/9473582/ios-javascript-bridge