首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >离子行显示同一行的所有元素。

离子行显示同一行的所有元素。
EN

Stack Overflow用户
提问于 2018-04-25 18:59:07
回答 1查看 1.1K关注 0票数 0

如果单击反向图标(旋转交换图标),我必须显示倒转的货币汇率。然而,我的倒图标总是滑到换行符上。我怎么才能避免呢?我需要与行中的其他元素保持相同的行。我左边什么都没有。

代码语言:javascript
复制
  <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:

代码语言:javascript
复制
.rotate90 {
  -webkit-transform: rotate(90deg);
  -moz-transform: rotate(90deg);
  -o-transform: rotate(90deg);
  -ms-transform: rotate(90deg);
  transform: rotate(90deg);
  padding-right: 10px;
}

截图:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-25 19:45:23

因为你说,内容调整大小,按钮没有足够的空间,因此它转到下一行。

这方面的解决方案将被分配到固定的按钮,组剩余内容和使用。

代码语言:javascript
复制
width:calc(100% - 30px); 

关于内容的评论。

请注意,width:calc(100% - 30px)还应该考虑到适用于按钮或内容的任何保证金。

代码语言:javascript
复制
.inner{
  display:inline:block;
  width:calc(100% - 30px); /*30px. should be same as button width */ 
}
.buuton{
  width:30px;
}
代码语言:javascript
复制
<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>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50029566

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档