详细问题描述
[内容]通过通知的方法解决白屏问题,但是进入主页只有状态栏和页面之间有20的间隙
重现步骤
[步骤]
[结果]
[期望]
运行环境
[系统版本]
[浏览器版本]
[IDE版本]
[mui版本]
附件
[代码片段]
-
(void)loadView
{
[super loadView];
// self.automaticallyAdjustsScrollViewInsets = NO;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(replaceToH5View) name:PDRCoreAppFrameDidLoadNotificationKey object:nil];
if(pContentVIew == nil)
pContentVIew = [[UIView alloc] initWithFrame:self.view.frame];
// pContentVIew.backgroundColor = [UIColor redColor];
[self.view addSubview: pContentVIew];UIImageView *bgImageV = [[UIImageView alloc] initWithFrame:self.view.bounds];
bgImageV.image = [UIImage imageNamed:@"1242x2208"];
[pContentVIew addSubview:bgImageV];PDRCore *h5Engine = [PDRCore Instance];
[self setStatusBarStyle:h5Engine.settings.statusBarStyle];
_isFullScreen = [UIApplication sharedApplication].statusBarHidden;
if ( _isFullScreen != h5Engine.settings.fullScreen ) {
_isFullScreen = h5Engine.settings.fullScreen;
if ( [self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)] ) {
[self setNeedsStatusBarAppearanceUpdate];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:_isFullScreen];
}
}
h5Engine.coreDeleagete = self;
h5Engine.persentViewController = self;// 设置WebApp所在的目录,该目录下必须有mainfest.json
NSString* pWWWPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Pandora/apps/HelloH5/www"];NSString* pArgus = @"id=plus.runtime.arguments";
// 启动该应用pAppHandle = [[[PDRCore Instance] appManager] openAppAtLocation:pWWWPath withIndexPath:@"login.html" withArgs:pArgus withDelegate:nil];
// 如果应用可能会重复打开的话建议使用restart方法
//[[[PDRCore Instance] appManager] restart:pAppHandle];
} -
(void)replaceToH5View{
// 设置5+SDK运行的View
[[PDRCore Instance] setContainerView:pContentVIew];
}
[安装包]
联系方式
[QQ]1089036
[电话]