【问题标题】:How to design a message Toast in sapui5如何在 sapui5 中设计消息 Toast
【发布时间】:2020-08-26 12:51:43
【问题描述】:
我想在 2 行而不是 1 行中显示消息 toast,
我怎么做?
另外我需要设计它的不透明度,特定的颜色和尺寸?
有什么想法吗?
var message = this._oBundle.getText("Paymentdeclined");
sap.m.MessageToast.show(消息);
【问题讨论】:
标签:
javascript
css
sapui5
message
【解决方案1】:
为了在换行中显示文本,您可以在需要换行的地方包含换行符(\n)。为了改变 MessageToast 的不透明度和颜色,您需要应用您的自定义 CSS。示例:-
sap.m.MessageToast.show('Lorem \n ipsum \n dolor sit amet', {
duration: 3000,
width: "15rem", // default max width supported
});
/* width properties are required only if the width required is more than 15rem*/
.sapMMessageToast{
background : #629192 !important;
width:25rem !important;
max-width : 25rem !important;
opacity: 0.5 !important;
}
但请记住,这将应用于所有 MessageToast 吐司。