简体   繁体   English

mat-dialog 没有填充屏幕 - Angular

[英]mat-dialog not filling screen - Angular

I have an image carousel inside a mat-dialog.我在垫子对话框中有一个图像轮播。 It doesn't really matter what component I feed the mat-dialog.我为 mat-dialog 提供什么组件并不重要。 They never fill the screen so I don't think it's the specific component inside mat-dialog that's the issue.它们永远不会填满屏幕,所以我认为这不是 mat-dialog 中的特定组件的问题。

在此处输入图片说明

I want it to fill the width 100% and height:auto to make the image fit correctly, but it doesn't seem to work and I have no idea why.我希望它填充宽度 100% 和height:auto以使图像正确适合,但它似乎不起作用,我不知道为什么。


  openImageGalleryMobile(images) {
    const imageDialogRef = this.dialog.open(ImageCarouselComponent, {
      panelClass: "matdialogStyle",
      data: { images: images},
      height: 'auto',
      width: '100%',
    });

    imageDialogRef
      .afterClosed()
      .pipe(takeUntil(this.destroy))
      .subscribe(result => { });
  }
<div id="imageSlideshow">

  <ngb-carousel *ngIf="images">
    <ng-template ngbSlide *ngFor="let image of images">
      <img src='{{image}}' alt="Random first side">

    </ng-template>

  </ngb-carousel>



</div>

I tried adding .matdialogStyle as a new unaltered css class, but issue is still there.我尝试将.matdialogStyle添加为一个新的未.matdialogStyle css 类,但问题仍然存在。 I tried setting the width to 100% from component css file or styles.css file using matdialogStyle css class, but it never updates.我尝试使用matdialogStyle css 类将组件 css 文件或matdialogStyle文件的宽度设置为 100%,但它永远不会更新。 I appreciate the help!我感谢您的帮助!

Can you try :你能试一下吗 :

{
  panelClass: "matdialogStyle",
  data: { images: images},
  height: 'auto',
  minWidth: '100%',
}

and you can add for height 100% :你可以添加高度 100% :

minHeight: '100vh'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular 8 中的可拖动和可调整大小的垫子对话框 - draggable and resizeable mat-dialog in Angular 8 Angular 8 从全屏打印垫对话框中去除打印介质中的奇怪线条 - Angular 8 remove weird lines from print media from printing mat-dialog in full screen size Angular Material - Mat-Dialog - 改变背景模糊/变暗效果 - Angular Material - Mat-Dialog - change background blur / darkening effect Angular Material Theme 不会改变 mat-dialog 强调色 - Angular Material Theme does not change the mat-dialog accent color 隐藏/显示 Angular 材料垫对话框中的列 - Hide/Show column in Angular material mat-dialog Angular - 如何使 mat-dialog 内的 mat-stepper 内的元素调整到对话框的高度? - Angular - How to make elements inside mat-stepper inside mat-dialog adjust to the height of the dialog? 将背景图像添加到 mat-dialog - Adding background-image to mat-dialog Angular Mat-dialog 显示了两个滚动条,如何删除第二个? - Angular Mat-dialog is displaying two scrollbars, how can I remove the second? 如何为 angular 材料垫选择使用“.cdk-overlay-pane”自定义或应用另一个 class 垫子对话框 - How to customize or apply another class with ".cdk-overlay-pane" for angular material mat-select | mat-dialog 如何在 mat-对话框中放置列和行 - How to place columns and rows in mat-dialog box
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM