uniapp app端弹窗提示 代码块

前提:uniapp的app端,用uni自带的toast,icon会自占一行,很丑

如图:image

利用 plus.nativeUI.toast 显示正常大小的icon


 plus.nativeUI.toast(
    e,//提示文字
    {
      type: 'text',
      duration: 'short',
      iconWidth: "24px",
      iconHeight: "24px",
      style: "inline",
      align: 'center',
      verticalAlign: 'center',
      icon: "/static/images/icon/success.png"
    });

效果如图: image


参考网址:
https://www.html5plus.org/doc/zh_cn/nativeui.html#plus.nativeUI.toast

posted @ 2025-02-28 10:29  格林格林  阅读(90)  评论(0)    收藏  举报