如何在本机应用程序中打开HTML页面?

时间:2022-06-05 06:38:08

i an new in this Field.I want to open static HTML page which i have so how can i open that page in my application.

我是这个领域的新手。我想打开我拥有的静态HTML页面我如何在我的应用程序中打开这个页面。

2 个解决方案

#1


2  

NSBundle *bundle = [NSBundle mainBundle];

NSString *htmlTemplateLink = [bundle pathForResource:@"infopage" ofType:@"html"];

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlTemplateLink]];

wview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];
wview.scalesPageToFit = YES;
[wview loadRequest:request];
wview.delegate=self;

//wview.multipleTouchEnabled=YES;
wview.userInteractionEnabled=YES;

[self.view addSubview:wview];

#2


0  

See UIWebView and its -loadRequest: method.

参见UIWebView及其-loadRequest:方法。

#1


2  

NSBundle *bundle = [NSBundle mainBundle];

NSString *htmlTemplateLink = [bundle pathForResource:@"infopage" ofType:@"html"];

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlTemplateLink]];

wview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];
wview.scalesPageToFit = YES;
[wview loadRequest:request];
wview.delegate=self;

//wview.multipleTouchEnabled=YES;
wview.userInteractionEnabled=YES;

[self.view addSubview:wview];

#2


0  

See UIWebView and its -loadRequest: method.

参见UIWebView及其-loadRequest:方法。