アプリでwebviewを使う
詳細
まずview base appを作成します.viewcontroller.を開くxib、webviewを1つ置いて、status barが必要でなければ隠して、viewに設定します.
viewcontroller.hに加える
ibでは、uiwebviewの参照をfile's ownerに引き、webViewを選択して変数を関連付けます.
viewcontroller.mに加えて
urlをロードするコードを追加します.
実行が駆けつけるとデフォルトでgoogleにロードされます.フルスクリーンが必要ならplistに追加
Status bar is initially hidden = true
クロススクリーンならプラス
Initial interface orientation=Landscape (right home button)
参照先:
http://www.iphonesdkarticles.com/2008/08/uiwebview-tutorial.html
http://www.edumobile.org/iphone/ipad-development/webview-application-in-ipad/#
まずview base appを作成します.viewcontroller.を開くxib、webviewを1つ置いて、status barが必要でなければ隠して、viewに設定します.
viewcontroller.hに加える
IBOutlet UIWebView *webView;
@property (nonatomic, retain) UIWebView *webView;
ibでは、uiwebviewの参照をfile's ownerに引き、webViewを選択して変数を関連付けます.
viewcontroller.mに加えて
@synthesize webView;
urlをロードするコードを追加します.
- (void)viewDidLoad {
NSString *urlAddress = @"http://www.google.com";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[webView loadRequest:requestObj];
}
実行が駆けつけるとデフォルトでgoogleにロードされます.フルスクリーンが必要ならplistに追加
Status bar is initially hidden = true
クロススクリーンならプラス
Initial interface orientation=Landscape (right home button)
参照先:
http://www.iphonesdkarticles.com/2008/08/uiwebview-tutorial.html
http://www.edumobile.org/iphone/ipad-development/webview-application-in-ipad/#