UI5 ListMode.SingleSelectMaster忽略ListitemType.Inactive

UI5 ListMode.SingleSelectMaster忽略ListitemType.Inactive,list,sapui5,List,Sapui5,我尝试创建一个具有SingleSelectMaster模式的列表,以便突出显示最后选定的项目。 在我的列表中,有几个ListItem是“非活动的”,如果我单击这些,列表不会触发itemPress事件。那很好!但是列表会突出显示这些元素,并且列表会在非活动元素上提供悬停效果 <List itemPress="toDetailPage" mode="SingleSelectMaster" > <items> <CustomListItem typ

我尝试创建一个具有SingleSelectMaster模式的列表,以便突出显示最后选定的项目。 在我的列表中,有几个ListItem是“非活动的”,如果我单击这些,列表不会触发itemPress事件。那很好!但是列表会突出显示这些元素,并且列表会在非活动元素上提供悬停效果

<List itemPress="toDetailPage" mode="SingleSelectMaster" >
    <items>
        <CustomListItem type="Active" >
            <HBox class="sapUiSmallMargin">
                <Label text="Type: Active"/>
            </HBox>
        </CustomListItem>
        <CustomListItem type="Active" >
            <HBox class="sapUiSmallMargin">
                <Label text="Type: Active"/>
            </HBox>
        </CustomListItem>
        <CustomListItem type="Inactive" >
            <HBox class="sapUiSmallMargin">
                <Label text="Type: Inactive"/>
            </HBox>
        </CustomListItem>
        <CustomListItem type="Inactive" >
            <HBox class="sapUiSmallMargin">
                <Label text="Type: Inactive"/>
            </HBox>
        </CustomListItem>
    </items>
</List>

谢谢大家!

类型属性与禁用属性不同。在SAPUI5中,无法轻松实现“禁用”列表元素。您可以做的是为处于“非活动状态”的customListItem实现一个自定义控件。有关如何执行自定义控件,请参阅本指南: