How to position a popover in Ionic 2

后端 未结 7 560
别那么骄傲
别那么骄傲 2020-12-08 15:25

How do I manually position a popover in Ionic 2?

I can\'t set the position in a css class, since the popover controller sets the position with an inline style.

7条回答
  •  广开言路
    2020-12-08 15:42

    For me, the problem was solved by setting the position using css. First you have to set the cssClass of your element:

    Component/Page code:

    async showPopover (ev) { 
     component: myComponent,
     event: ev,
     cssClass: 'myPopoverStyle'
    }
    

    then, you have to set the global css (generally app.scss).

    app.scss

    .myPopoverStyle .popover-content{
        top: 60px !important;
    }
    

提交回复
热议问题