Ionic framework 屏幕末尾显示的离子4弹出窗口
我正在使用popupcontroller的自定义弹出窗口。问题是当弹出窗口在应用程序中第一次打开时。然后它显示在屏幕的末尾,但在第二次查看时,它显示在中间。我需要它始终显示中心,而不是底部或末端 这是我的密码 home.tsIonic framework 屏幕末尾显示的离子4弹出窗口,ionic-framework,ionic4,Ionic Framework,Ionic4,我正在使用popupcontroller的自定义弹出窗口。问题是当弹出窗口在应用程序中第一次打开时。然后它显示在屏幕的末尾,但在第二次查看时,它显示在中间。我需要它始终显示中心,而不是底部或末端 这是我的密码 home.ts async presentPopover(popData) { const popover = await this.popoverController.create({ component: RedeemPopupComponent,
async presentPopover(popData) {
const popover = await this.popoverController.create({
component: RedeemPopupComponent,
componentProps: {
"title": popData.title,
"sub": popData.sub,
"img": popData.img,
"button": popData.button,
},
translucent: true,
backdropDismiss: false
});
return await popover.present();
}
popup.html
<ion-card style="background-color: white; border-color: 2px solid #1d808c">
<div style="text-align: right;" (click)="cancel()">
<ion-icon name="close" style="font-size: 25px;" color="secondary"></ion-icon>
</div>
<div style="text-align: center;" *ngIf="img">
<img src="{{img}}">
</div>
<h3 class="ion-margin-top ion-text-center" style="color: #1d808c" *ngIf="title">
{{title}}
</h3>
<h5 class="ion-text-center" style="color: #1d808c" *ngIf="sub">
{{sub}}
</h5>
<div style="margin-top: 30px;text-align: center;" *ngIf="button == 'CLOSE'">
<ion-button color="secondary" style="font-size: 20px;width: 140px;height: 56px;--border-radius: 140px !important;font-weight: 600;text-transform: none;" (click)="cancel()">{{button}}</ion-button>
</div>
<div style="margin-top: 30px;text-align: center;" *ngIf="button == 'REDEEM'" (click)="redeem()">
<ion-button color="secondary" style="font-size: 20px;width: 140px;height: 56px;--border-radius: 140px !important;font-weight: 600;text-transform: none;" (click)="cancel()">{{button}}</ion-button>
</div>
</ion-card>
{{title}}
{{sub}}
{{按钮}
{{按钮}
另外,将图像附在底部,仅在其打开后第一次显示弹出窗口,而在中间显示时将第二次打开弹出窗口
面向同一方向。。解决者 global.scss
.pop-over-celebrate .popover-content {
position:static;
width: 86% !important;
margin-left: 7% !important;
}
在ts中添加此自定义类
cssClass: 'pop-over-celebrate',
面对同样的。。解决者 global.scss
.pop-over-celebrate .popover-content {
position:static;
width: 86% !important;
margin-left: 7% !important;
}
在ts中添加此自定义类
cssClass: 'pop-over-celebrate',
使用ionic
Ionion modal
/ModalController
而不是PopupController
,它应该可以工作。(到目前为止,此问题只有一个解决方案。)
使用ionic
Ionion modal
/ModalController
而不是PopupController
,它应该可以工作。(到目前为止,此问题只有一个解决方案。)