DOCTYPE html& gt;的声明不适用于IBM MobileFirst中的Ionic' s ion-nav-view [英] Declaration of <!DOCTYPE html> does not work with Ionic's ion-nav-view in IBM MobileFirst
问题描述
我是将IBM MobileFirst与Ionic结合使用来构建混合移动应用程序的初学者.当前,我能够在MobileFirst Console模拟器,模拟器以及Android移动设备中构建和运行我的应用程序.但是,仅当删除<!DOCTYPE html>
的声明时,所有这些方法才能正常工作.如果包含<!DOCTYPE html>
,ion-nav-view将不起作用.
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.
我提到了基于离子的IBM MobileFirst Starter Application示例.在此示例中,使用ng-view代替ion-nav-view,因此<!DOCTYPE html>
的声明不会引起任何问题.
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.
示例应用程序(Android): https://github.com/user4706148/MobileFirstProject 有人知道这个问题吗?
Sample application (Android): https://github.com/user4706148/MobileFirstProject Does anyone know about this issue?
推荐答案
它看起来像是自动生成并自动插入的worklight.css(可以在生成的Android项目中找到> asset \ default \ www \ worklight \ worklight.css)触发此问题.
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.
我猜想其中的CSS规则会根据所使用的doctype呈现不同的呈现方式.具体来说,这是由于以下规则而发生的:
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;
}
您不得编辑此文件(因为该文件会在MFP Studio的每个版本中重新生成),因此您可以执行的操作是在自己的应用程序的自定义.css文件中覆盖该文件.
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.
这似乎工作正常:
body {
position: none !important;
}
这篇关于DOCTYPE html& gt;的声明不适用于IBM MobileFirst中的Ionic' s ion-nav-view的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!