我正在使用材质对话框,需要将我的大小调整到对话框的边缘。我有什么(:
我需要什么(窗户的整个上部都被涂上了,而不仅仅是条带):
我的解决方案不起作用:
export class DialogComponent implements AfterViewInit {
@Input() parent : HTMLElement;
dialogProperties = [];
ngAfterViewInit(): void {
this.dialogProperties['height'] = this.parent.clientHeight;
this.dialogProperties['width'] = this.parent.clientWidth;
}
}
<div fxLayout="column" fxLayoutAlign="space-between stretch" style="height: 100%; position: relative">
<div class="title" mat-dialog-title>
<h1 class="header-mat-dialog" [ngStyle]="{'width': dialogProperties['width'], 'height': dialogProperties['height']}" fxLayout="row" fxLayoutAlign="start center">Title</h1>
</div>
<div class="content" mat-card-content style="flex-grow: 1;">
</div>
<div class="bottom" fxFlex>
</div>
</div>
.header-mat-dialog {
text-align: center;
display: flex;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: #01A4B1;
color: white;
}
.title {;
display: inline-block;
}
.content {
display: inline-block;
}
.bottom {
display: inline-block;
vertical-align: bottom;
}