簡體   English   中英

彈出框,模式組件或頁面的Ionic 4自定義樣式

[英]Ionic 4 custom styling of popover, modal components or pages

我在Ionic 4中使用了我的應用程序,但是我不明白如何自定義組件。 我想在右上角顯示對齊位置。

我已經嘗試了global.css文件以及component.css文件,但是沒有任何運氣。

async getNotifications() {
    const popover = await this.popoverController.create({
      component: NotificationComponent,
      // event: ev,
      cssClass: 'notificationCSS',
      translucent: true
    });
    return await popover.present();
  }

在通知CSS中:

 .notificationCSS{
      top: 0px !important;
      right: 0px !important;
  }

參考 網址

我在ionic中也遇到過類似的問題,無法動態呈現html元素(在環環世界中可能並不完全正確)。 我的組件css文件沒有選擇我要定位的類。 但是global.css做到了。 我會嘗試再次將您的CSS放到全局。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM