ionic和cordova - css主动不在Android设备上工作 [英] ionic and cordova - css active not working on android device
问题描述
我正在使用带有cordova平台的离子框架。元素(div,button或a)的活动状态的css在开发/测试期间在浏览器中正常工作,但在android设备/模拟器中根本不工作
I am using ionic framework with cordova platform. The css for active state of an element (div, button or a) works fine in browser during development/testing but not at all in android device/emulator
我已定义一些课程
.bg-dark {
background: #333333 !important;
}
.bg-active-darkBlue:active {
background: #16499a !important;
}
及以下html
<a class="fg-white bg-active-darkBlue button" style="background-color:#3B5998;">Sign in with Facebook</a>
甚至试过这个(上离子论坛)
even tried this (got on ionic forum)
<a ng-mousedown="class='bg-active-darkBlue'" ng-mouseup="class='bg-dark'" menu-close class="fg-white {{class}}">Sign in with Facebook</a>
尝试使用div,button标签。
仍然没有在android上运行,只能在浏览器中运行,请帮忙。
tried for a,div and button tags. still not working on android, only works in browser, please help.
推荐答案
根据经验,角度 ng-mousedown
和 ng-mouseup
事件不会在移动设备上启动。我的经验是iOS上的离子1.6.4。
By experience, angular ng-mousedown
andng-mouseup
events do not fire up on the mobile device. My experience was ionic 1.6.4 on iOS.
然而,触控和发布功能完美无瑕。所以只需用 on-touch $ c替换
ng-mousedown
和 ng-mouseup
$ c>和分别发布
。
However, on-touch and on-release works flawlessly well. So just replace ng-mousedown
and ng-mouseup
with on-touch
and on-release
, respectively.
< a on-touch =class ='bg-active-darkBlue'on-release =class ='bg-dark'menu-close class =fg-white {{class}}>使用Facebook登录< / a>
这是指针指向 on-touch
和 on-release
事件的离子参考文档。
Here is the pointer to the ionic reference documentation on the on-touch
and on-release
events.
希望这会有所帮助..
Hope this helps..
这篇关于ionic和cordova - css主动不在Android设备上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!