UIWebView的基本使用
来源:互联网 发布:网络小说家花刺 编辑:程序博客网 时间:2024/04/28 20:03
- (void)embedInternalVideo:(CGRect)frame { NSBundle *bundle = [NSBundle mainBundle]; NSString* html = @"<video src=\"sample_iPod.m4v\" width=640 height-480 controls autoplay></video>"; if (videoView == nil) { videoView = [[UIWebView alloc] initWithFrame:frame]; [self.view addSubview:videoView]; } [videoView loadHTMLString:html baseURL:[bundle resourceURL]]; }//=======================self.webView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:string]]; [self.webView loadRequest:request];