Hello Anyone please tell me how can change the loading class in xcode like index.html to login.html in ios. I am new in ios so please help me.
the proper way of doing this, and without code changes is changing this line on the config.xml from
<content src="index.html"/>
to
<content src="login.html"/>
The simplest way I did is, xxxViewController: CDVViewController<...>
then you can write on 'init' or 'viewDidLoad'
- (id)init{
self = [super init];
if(self){
self.wwwFolderName = @"dist/view";
self.startPage = @"test.html";
}
return self;
}
or
-(void) viewDidLoad{
self.wwwFolderName = @"dist/view";
self.startPage = @"test.html";
[super viewDidLoad];
}
so,that is all.
以下代码将在项目文件夹中加载一个名为index.html的HTML文件:
[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.