【问题标题】:Ionic FabButton not properly working on iPhoneIonic FabButton 在 iPhone 上无法正常工作
【发布时间】:2018-12-27 06:03:54
【问题描述】:

我正在使用 Ionic FabButton 作为固定位置内容上方的浮动按钮。我的代码是:-

<ion-fab bottom right class="fab-image" (tap)="nextStep()">
   <button ion-fab style="display: none;"></button>
   <img src="assets/icon/custom/green_arrow.png" alt="">
</ion-fab>

fab-image 我的 CSS 如下:-

.fab-image{
  position: fixed !important;
  width: 62px;
}

现在它在 Android 上运行得很好:-

Click here to see how it's working on Android

在 iPhone 中它的工作原理是这样的:

Click here to see how it working on iPhone

问题是 iPhone 上的故障。 fab 按钮随着屏幕的移动而移动。任何想法如何解决这个问题?

【问题讨论】:

标签: ionic-framework ionic-native floating-action-button


【解决方案1】:

我在 IOS 上遇到了同样的问题,fab 没有修复,这是我的代码。

<ion-content>
    <!--other code-->

    <ion-fab class="centered-fab" bottom>
         <button  ion-button block round color="primary" (click)="onClick()">
          Click Me
         </button>
    </ion-fab>
</ion-content>

我搬出去后问题就消失了

<ion-content>
    <!--other code-->
</ion-content>

<ion-fab class="centered-fab" bottom>
     <button  ion-button block round color="primary" (click)="onClick()">
      Click Me
     </button>
</ion-fab>

【讨论】:

  • 这也完全解决了我的问题。知道为什么吗?谢谢回复。我会把它标记为答案
  • 不,我不知道究竟是为什么...花了几个小时在 Ionic github 问题和论坛上搜索,终于弄明白了
猜你喜欢
  • 2023-03-06
  • 1970-01-01
  • 2013-10-03
  • 2020-01-14
  • 2019-02-04
  • 2023-03-26
  • 2014-03-10
  • 1970-01-01
  • 2021-07-14
相关资源
最近更新 更多