首页 > 解决方案 > 当它有 2 个输入时,给一个样式以在 AlertController 上显示完整的按钮

问题描述

我使用带有 2 个输入框的AlertController 。因此,我只能看到一半的按钮。那么,当设备上打开键盘时,如何设置它以显示完整按钮?

我试过这个:但它永远不会在运行时应用。

1.scss

   .alert-button-group {
        margin-top: -25px !important;
    }

在此处输入图像描述

.ts

myAlert(){

const alert = this.alertCtrl.create({
      title: this.enterApiKeyText,
      inputs: [
        {
          name: 'apiKey',
          placeholder: this.apiKey
        },
        {
          name: 'apiName',
          placeholder: this.apiName
        },
      ],
      buttons: [
        {
          text: 'Cancel',
          handler: data => {
          }
        },
        {
          text: 'Save',
          handler: (data) => {           

            }
          }
        }
      ]
    });
    alert.present();
}

.html

<ion-row>
    <ion-col col-3 tappable (click)="myAlert()">
      <button ion-fab mini>
        <ion-icon name="add"></ion-icon>
      </button>
    </ion-col>
  </ion-row>

标签: cssangularionic-frameworksassionic3

解决方案


我找到了解决方案。

医生在这里

变量.scss

$alert-md-message-padding-bottom:0;
$alert-ios-message-padding-bottom:0;

推荐阅读