如果单击反向图标(旋转交换图标),我必须显示倒转的货币汇率。然而,我的倒图标总是滑到换行符上。我怎么才能避免呢?我需要与行中的其他元素保持相同的行。我左边什么都没有。
<ion-row>
<div col-7 offset-5 no-padding text-right>
<ion-label *ngIf="!showInverted" no-margin class="rate label-tx">1 {{transaction.SendCurrency}} = {{transaction.ExchangeRate | amountFormat}} {{transaction.PayoutCurrency }}</ion-label>
<ion-label *ngIf="showInverted" no-margin class="rate label-tx">1 {{transaction.PayoutCurrency}} = {{1/transaction.ExchangeRate | amountFormat}} {{transaction.SendCurrency }}</ion-label>
<button (click)="showInvertedRate()" ion-button clear color="dark"> <ion-icon name="swap" class="rotate90"></ion-icon></button>
</div>
</ion-row>
In my Ts file:
showInvertedRate()
{
this.showInverted = !this.showInverted ;
}我的Scss:
.rotate90 {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
padding-right: 10px;
}截图:

发布于 2018-04-25 19:45:23
因为你说,内容调整大小,按钮没有足够的空间,因此它转到下一行。
这方面的解决方案将被分配到固定的按钮,组剩余内容和使用。
width:calc(100% - 30px); 关于内容的评论。
请注意,width:calc(100% - 30px)还应该考虑到适用于按钮或内容的任何保证金。
.inner{
display:inline:block;
width:calc(100% - 30px); /*30px. should be same as button width */
}
.buuton{
width:30px;
}<ion-row>
<div col-7 offset-5 no-padding text-right>
<div class="inner">
<ion-label *ngIf="!showInverted" no-margin class="rate label-tx">1 </ion-label>
<ion-label *ngIf="showInverted" no-margin class="rate label-tx">1 </ion-label>
</div>
<button (click)="showInvertedRate()" ion-button clear color="dark"> <ion-icon name="swap" class="rotate90"></ion-icon></button>
</div>
</ion-row>
https://stackoverflow.com/questions/50029566
复制相似问题