对话框 CSS 样式 SAP UI5

Dialog CSS Style SAP UI5

我有一个简单的 SAP UI5 应用程序,用户在其中打开一个添加对话框 pop-up, 我想改变对话框的样式,对话框的xml是这样的:

<core:FragmentDefinition xmlns="sap.m" xmlns:core ="sap.ui.core" xmlns:html="http://www.w3.org/1999/xhtml>"
   <Dialog title="Add" class="sapUiPopupWithPadding">
     <Input type="Text"/>
     <buttons class="buttonsStyle">
       <Button text="Save"/>
       <Button text="Cancel"/>
     </buttons>
   </Dialog>
 </core:FragmentDefinition>

CSS:

.buttonsStyle {
 background-color: #d8d8d8 !important;
}

不管我怎么改都得到和图片一样的结果CSS,我想改变对话框标题(添加)的颜色和大小以及对话框的背景颜色和字体颜色按钮,但通过尝试和搜索我没有得到任何结果。

谢谢。

对于按钮,您应该优先使用 type 属性而不是自定义 CSS ;)

请参阅 ButtonTypeAPI 参考和示例

https://sapui5.hana.ondemand.com/#/api/sap.m.Button%23controlProperties https://sapui5.hana.ondemand.com/#/api/sap.m.ButtonType https://sapui5.hana.ondemand.com/#/entity/sap.m.Button/sample/sap.m.sample.Button

对于对话框,您可以使用 customHeader 聚合并使用一些可自定义的组件来代替标题。

https://sapui5.hana.ondemand.com/#/api/sap.m.Dialog%23aggregations