<!DOCTYPE html>声明在IBM MobileFirst中不支持Ionic的ion-nav-view [英] Declaration of <!DOCTYPE html> does not work with Ionic's ion-nav-view in IBM MobileFirst

查看:82
本文介绍了<!DOCTYPE html>声明在IBM MobileFirst中不支持Ionic的ion-nav-view的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用IBM MobileFirst和Ionic构建混合移动应用程序的初学者。目前,我能够在MobileFirst Console模拟器,模拟器以及Android移动设备中构建和运行我的应用程序。但是,只有当我移除<!DOCTYPE html> 的声明时,所有这些才能正常工作。如果包含<!DOCTYPE html> ,则ion-nav-view不起作用。 基于Ionic的IBM MobileFirst Starter Application示例。在这个例子中,ng-view被用来代替ion-nav-view,因此声明<!DOCTYPE html> 不会导致任何问题。



示例应用程序(Android): https://github.com/user4706148/MobileFirstProject
有人知道这个问题吗?

解决方案

它看起来像是自动生成的自动插入worklight.css(可以在生成的Android项目> assets \ default_\\\ worklight\worklight.css中找到)触发此问题。



<我猜根据使用的文档类型,其中的CSS规则呈现得不同。具体来说,这是由于以下规则:

  body {
position:relative;
}

您不得编辑此文件(因为它会在每个构建中重新生成在MFP Studio中),所以你可以做的就是在你自己的应用程序的自定义.css文件中覆盖它。



这似乎工作正常:

  body {
position:none!important;
}


I am a beginner in using IBM MobileFirst with Ionic to build hybrid mobile apps. Currently, I am able to build and run my application in the MobileFirst Console simulator, emulator, as well as in an Android mobile device. However, all these can work well only when I remove the declaration of <!DOCTYPE html>. If <!DOCTYPE html> is included, ion-nav-view does not work.

I referred to the Ionic-based IBM MobileFirst Starter Application samples. In the example, ng-view is used instead of ion-nav-view, thus declaration of <!DOCTYPE html> does not cause any issues.

Sample application (Android): https://github.com/user4706148/MobileFirstProject Does anyone know about this issue?

解决方案

It looks like it is the auto-generated and auto-inserted worklight.css (can be found in the generated Android project > assets\default\www\worklight\worklight.css) that triggers this issue.

I guess the CSS rules within it get rendered differently according to the used doctype. Specifically, this is happening due to the following rule:

body {
    position: relative;
}

You must not edit this file (as it gets re-generated on every build in MFP Studio) so what you can do instead is to override it in your own app's custom .css file.

This seems to work fine:

body {
    position: none !important;
}

这篇关于&lt;!DOCTYPE html&gt;声明在IBM MobileFirst中不支持Ionic的ion-nav-view的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆