如何覆盖 listItem 图标工具提示?

我正在尝试更改核心图标的工具提示:ListItem。

listItem 的工具提示属性正在更改整个项目的工具提示,这不是我要找的。

<core:ListItem icon="sap-icon://message-error" tooltip="someTooltip" />


倚天杖
浏览 213回答 2
2回答

繁星淼淼

要么您需要扩展core: ListItemOR 您可以使用解决方法来解决您的问题,sap.m.CustomListItem并指定图标工具提示。视图文件<List items="{/items}">&nbsp; <CustomListItem>&nbsp; &nbsp; <HBox>&nbsp; &nbsp; &nbsp; <core:Icon size="2rem" width="50px" tooltip="{tooltipInfo}" src="{icon}" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <VBox>&nbsp; &nbsp; &nbsp; &nbsp; <Link text="{title}"/>&nbsp; &nbsp; &nbsp; &nbsp; <Label text="{type}"/>&nbsp; &nbsp; &nbsp; </VBox>&nbsp; &nbsp; </HBox>&nbsp; </CustomListItem></List>控制器.jsvar oModel = new sap.ui.model.json.JSONModel();oModel.setData({&nbsp; "items": [&nbsp; &nbsp; &nbsp;{ "tooltipInfo": "Group1", "icon": "sap-icon://hint", "type": "Monitor", "title": "Tiles: a modern UI design pattern for overview & navigation."},&nbsp; &nbsp; &nbsp;{ "tooltipInfo": "Group2", "icon": "sap-icon://inbox", "number": "89", "title": "Approve Leave Requests", "info": "Overdue", "infoState": "Error" },&nbsp; &nbsp; &nbsp;{ "tooltipInfo": "Group3", "icon": "sap-icon://email", "type": "Create", "title": "Create Leave Requests", "info": "28 Days Left", "infoState": "Success" },&nbsp; &nbsp; &nbsp;{ "tooltipInfo": "Group4", "icon": "sap-icon://travel-expense-report", "number": "281", "numberUnit": "euro", "title": "Travel Reimbursement", "info": "1 day ago" },&nbsp; &nbsp; &nbsp;{ "tooltipInfo": "Group5", "icon": "sap-icon://loan", "number": "2380", "numberUnit": "euro", "title": "My Salary", "info": "8 days ago" },&nbsp; &nbsp; &nbsp;{ "tooltipInfo": "Group6", "icon": "sap-icon://lab", "number": "1", "numberUnit": "Invention", "title": "Test Lab Reports","info": "8 Days Ago" }]});this.getView().setModel(oModel);输出
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript