Angular 如何对齐输入字段右侧的材质图标?
我正在使用mat自动完成文本框。我有一个搜索图标,目前它是左对齐的输入。我想把它对准右边。谁能帮我一下吗Angular 如何对齐输入字段右侧的材质图标?,angular,user-interface,angular-material,Angular,User Interface,Angular Material,我正在使用mat自动完成文本框。我有一个搜索图标,目前它是左对齐的输入。我想把它对准右边。谁能帮我一下吗 <mat-form-field floatLabel="never" class="example-full-width" appearance="outline"> <input type="search" placeholder="Name" aria-label="Number" matInput [formControl]="myCont
<mat-form-field floatLabel="never" class="example-full-width" appearance="outline">
<input type="search" placeholder="Name"
aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto" />
<mat-icon color="primary" matPrefix>search</mat-icon>
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
只需用matSuffix替换matPrefix
<mat-icon color="primary" matSuffix>search</mat-icon>