【问题标题】:Alert cuts long text in Ionic 4警报在 Ionic 4 中剪切长文本
【发布时间】:2019-04-16 05:17:12
【问题描述】:

如果警报的文本过多,则不会滚动文本,而是会剪切它甚至可以到达按钮。这是一个错误吗?我应该升报告吗?如何?我正在使用 Ionic 4 beta 12

代码:

  async showRules() {
    const alert = await this.alertController.create({
      header: 'Rules',
      subHeader: `Brain Builder is up to date with the most recent research regarding IQ enhancement.
As the most recent research suggest, Brain Builder will increase the number of stimulus first (position, audio, color, etc.).
Once all stimuli have been mastered, the n-back will be increased.A blue square will be shown every three seconds, press the button ‘Position’ when you find that the actual position of the blue square matches with that of the previous one.
The position of the square is accompanied with the pronunciation of a number and the very same rule applies for the sound.
`,
      buttons: ['OK'],
      backdropDismiss: false
    });
    await alert.present();
  }

【问题讨论】:

  • 嘿 Luis,你在模拟器或实际设备上检查过吗,我认为它可以在带有可滚动内容和警报按钮的设备上工作。

标签: ionic-framework ionic4


【解决方案1】:

您已将大量内容放在subheader 而不是message。试试:

 async showRules() {
    const alert = await this.alertController.create({
      header: 'Rules',
      message: `Brain Builder is up to date with the most recent research regarding IQ enhancement.
As the most recent research suggest, Brain Builder will increase the number of stimulus first (position, audio, color, etc.).
Once all stimuli have been mastered, the n-back will be increased.A blue square will be shown every three seconds, press the button ‘Position’ when you find that the actual position of the blue square matches with that of the previous one.
The position of the square is accompanied with the pronunciation of a number and the very same rule applies for the sound.
`,
      buttons: ['OK'],
      backdropDismiss: false
    });
    await alert.present();
  }

副标题只是副标题,可能不可滚动。文档here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-16
    • 1970-01-01
    • 1970-01-01
    • 2019-09-05
    • 1970-01-01
    • 2020-07-22
    • 2019-02-20
    相关资源
    最近更新 更多