关于WKWebView加载完毕的代理方法


现在在做一个项目,首页是原生的,然后页面上有10个左右的button,点击链接H5页面;
需求:在点击button的时候,当前页面出现loading动画,在H5页面加载完毕后跳转
我的思路:在button action的方法中,只是alloc init一个H5页面,在H5页面加载完毕的代理方法中发出Notification,然后在首页添加监听Notification,push页面.

button action的代码:

        self.aniCoverView.hidden = NO;
        self.gifView.image = [UIImage sd_animatedGIFNamed:@"aniGif"];
        [YKBNotificationCenter addObserver:self selector:@selector(closeAnimation:) name:YKBCloseAniNotification object:nil];
        hotelVC = nil;
        hotelVC = [[YNHotelController alloc] init];

H5页面中加载完毕发送的Notification:

       [YKBNotificationCenter postNotificationName:YKBCloseAniNotification object:nil userInfo:@{YKBURLString : self.urlString}];

首页监听Notification的方法:

           NSString * tempString = notifi.userInfo[YKBURLString];
            if ([tempString containsString:@"Flight/Search/"]) {
            jiPiaoVC.hidesBottomBarWhenPushed = YES;
            [self.tabBarController.parentViewController.navigationController pushViewController:jiPiaoVC animated:YES];
            [YKBNotificationCenter removeObserver:self name:YKBCloseAniNotification object:nil];
        }

现在有个问题:在跳转后页面会先白屏,然后才出现H5页面内容,怎样才能避过白屏,直接显示H5页面呢?跪求各路大神指点
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值