ionicのpopoverのios android上のスタイルの異なる解決方法

2767 ワード

$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>