Sapui5 如何在openui5中将样式类和图标添加到TabContainerItem

Sapui5 如何在openui5中将样式类和图标添加到TabContainerItem,sapui5,Sapui5,如何将样式类和图标添加到openui5中的选项卡containerItem? 在TabContainerItem文档中,没有addStyleClass和icon属性,可以在tabstrip中使用tab title。 但我需要使用TabContainerItem,因为它有tabs菜单,这在移动设备中很有用。 谁能帮帮我吗 oTabContainer = new sap.m.TabContainer("tabContainer", { items:

如何将样式类和图标添加到openui5中的
选项卡containerItem
? 在
TabContainerItem
文档中,没有
addStyleClass
icon
属性,可以在
tabstrip
中使用
tab title
。 但我需要使用
TabContainerItem
,因为它有
tabs菜单
,这在移动设备中很有用。 谁能帮帮我吗

oTabContainer = new sap.m.TabContainer("tabContainer", {
                items:
                [
                  new sap.m.TabContainerItem({name: "tab1",
                  content: [ 
                            new sap.ui.core.mvc.JSView({id:"tab1",viewName:"oui5mvc.tab1"})
                  ]}),
                  new sap.m.TabContainerItem({name: "tab2",
                  content: [ 
                            new sap.ui.core.mvc.JSView({id:"tab2",viewName:"oui5mvc.home"})
                  ]}),
                ]
}).placeAt("content").addStyleClass("tabContainer");  
这是一个我已经尝试过的方法。

因为直接从继承而非从继承不提供

但是,您仍然可以将自定义CSS应用于TabContainerItem,方法是向其TabContainerItem子项添加样式类,如:

/* class tabContainer as your custom class added to the TabContainer */

/* custom TabContainerItem (selected) */
.tabContainer 
.sapMTabStrip 
.sapMTSTabsContainer 
.sapMTSTabs 
.sapMTabStripItem.sapMTabStripItemSelected {
    color : green;
    background : yellow;
}

/* custom TabContainerItem (unselected) */
.tabContainer 
.sapMTabStrip 
.sapMTSTabsContainer 
.sapMTSTabs 
.sapMTabStripItem {
    color : white;
    background : grey;
}
这是你的护照。然后,您可以根据自己的需要使用基本的CSS规则进行调整


据我所知,目前不支持在TabContainerItem中添加图标/图像。您可以使用
增强功能
标签在上创建该功能的功能请求,也可以自己创建该功能请求。

您好,我需要为TabContainerItem name添加类。这样我就可以为我的选项卡标题设置样式。我需要在选项卡名称之前添加图标。现在,我相应地调整了答案。