zoukankan      html  css  js  c++  java
  • UIWebViewでローカルにあるHTMLを表示する&iOS6からtextAlignmentで指定する値が変更になった

    【objective-c】UIWebViewでローカルにあるHTMLを表示する


    xcode内にHTMLを格納して、そのHTMLをWebViewで表示する方法です。

    // UIWebViewの初期化
    UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    // htmlのパスの取得(今回はsample.html)
    NSString *path = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"html"];
    // ファイルの読み込み
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]]];
    [self.view addSubview:webView];


    iOS6からtextAlignmentで指定する値が変更になった

    以前 (iOS5以下)
    以前まではこんな感じです。

    (UITextView*)textView.textAlignment = UITextAlignmentCenter;指定する値も以下のものでした。
    •UITextAlignmentCenter
    •UITextAlignmentRight
    •UITextAlignmentLeft

    現在 (iOS6)
    現在 (iOS6)はこんな感じです。
    (UITextView*)textView.textAlignment = NSTextAlignmentCenter;指定する値も以下のものを使用する必要があります。
    •NSTextAlignmentCenter
    •NSTextAlignmentRight
    •NSTextAlignmentLeft

    以前のものを指定するとエラーが出るので注意です。

  • 相关阅读:
    tensorflow之tf.squeeze()
    tf.slice()
    tensorflow之tf.meshgrid()
    tensorflow: arg_scope()
    tf.ConfigProto()
    os.path.join()
    argparse.ArgumentParser()用法解析
    Flutter学习之ListView(1)
    Flutter学习之image
    Flutter学习之image
  • 原文地址:https://www.cnblogs.com/vonk/p/4269750.html
Copyright © 2011-2022 走看看