【发布时间】:2016-05-05 04:27:46
【问题描述】:
我们在 Cordova 应用中使用 Material Design Lite。
由于我不知道 Cordova 中 MDL 对话框的状态,我们决定使用 Modaal。
当我打开模式时,MDL 样式似乎可以工作,但输入字段不会浮动标签。我在一个普通的页面上试过这个,它似乎工作正常。
我附上了用于显示模态和模态 HTML 的代码。
$('#add-card').modaal({
overlay_opacity:0.5,
overlay_close:false,
hide_close:true,
after_open: function(){
componentHandler.upgradeDom();
}
});
<div id="dialog-add-card" class="dialog">
<h4>Add a New Card</h4>
<p class="colour-text-light">Please enter your email address</p>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="input-settings-add-card">
<label class="mdl-textfield__label" for="input-settings-add-card">Email</label>
</div>
<div class="settings-button">
<button id="button-dialog-add-card" class="mdl-button mdl-js-button mdl-button--raised colour-bg-action colour-text-white">Add</button>
</div>
<br />
<div class="settings-button-small">
<button id="button-dialog-add-card-cancel" class="mdl-button mdl-js-button colour-text-primary">Cancel</button>
</div>
</div>
【问题讨论】:
-
我也在我的一个应用中尝试过 MDL。遇到了很多问题。我建议你使用bootstrap material 或者如果你知道 angular 那么angular material 是最适合你的。
标签: cordova material-design-lite