【问题标题】:Ionic 4 custom styling of popover, modal components or pagesIonic 4 自定义弹出框、模态组件或页面样式
【发布时间】:2019-08-01 03:21:23
【问题描述】:

我的应用在 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;
  }

Ref. Url

【问题讨论】:

  • 把cssClass放到global.scss中

标签: html css angular ionic-framework


【解决方案1】:

我在 ionic 中遇到了类似的问题,用于动态(在角度世界中可能不完全正确)渲染的 html 元素。我的组件 css 文件没有选择我所针对的类。然而 global.css 做到了。我会尝试再次将您的 css 放入全局。

【讨论】:

  • 感谢@f1vlad,它通过继承popover-content类.notificationCSS .popover-content
猜你喜欢
  • 2019-12-19
  • 1970-01-01
  • 2019-04-10
  • 1970-01-01
  • 1970-01-01
  • 2015-03-22
  • 2019-07-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多