setDelayMSec(-1)表示在用户单击消息框之前显示消息.当用户点击外面的任何地方时,我可以关闭消息框吗?
尝试添加使用整个屏幕的标记,使用:
public void createAndShowNotification(String caption, String description, Notification.Type type) {
description += "<span style=\"position:fixed;top:0;left:0;width:100%;height:100%\"></span>";
Notification notif = new Notification(caption, description, type, true);
notif.setDelayMsec(-1);
notif.show(Page.getCurrent());
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2934 次 |
| 最近记录: |