先建一个view base app. 再打开viewcontroller.xib ,放上一个webview,如果不需要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)
参考:
[url]http://www.iphonesdkarticles.com/2008/08/uiwebview-tutorial.html[/url]
[url]http://www.edumobile.org/iphone/ipad-development/webview-application-in-ipad/#[/url]
在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)
参考:
[url]http://www.iphonesdkarticles.com/2008/08/uiwebview-tutorial.html[/url]
[url]http://www.edumobile.org/iphone/ipad-development/webview-application-in-ipad/#[/url]