$scope.openPopover = function($event,flag) {
//去掉所有的样式
document.body.classList.remove('platform-ios');
document.body.classList.remove('platform-android');
//使用ios的样式
document.body.classList.add('platform-ios');
}
以上方法会产生副作用:增加ion-nav-bar的高度。
终极解决方案:自定义popover的html中在最外层加一个div,然后修改成和ios一样的样式。
<div class="my-popover">
<ion-popover-view
style="padding: 0;margin: 0;background-color: #880015">
<ion-content style="padding: 0;margin: 0;">
<div class="list " style="color: #880015;">
<a class="item " style="background-color: #880015; color: white;text-align: center;" href="" ng-repeat="item in popoverItems"
ng-click="popoverMenuClick($index,item)">
{{item}}
</a>
</div>
</ion-content>
</ion-popover-view>
</div>