function ItemTips.GetCustomShow(parent, data, isPetItem)
if not data or next(data) == nil then
return nil
end
if not parent then
return
end
local str = ""
local list = GUI:ListView_Create(parent, "Custom_list"
获取分类名称的代码在`ItemTips.GetCustomTitleShow`函数中。这个函数根据传入的索引`p`、内容`content`和颜色`color`来创建分类标题。
具体位置在代码的这部分:
```lua
if isShowAttr then
local title = ItemTips.GetCustomTitleShow(p, list, d.t, d.c)
if title then
local titleSize = GUI:getContentSize(title)
listSize.height = listSize.height + titleSize.height + (_setVspace or 0)
listSize.width = math.max(listSize.width, titleSize.width)
end
end
```
其中:
- `d.t` 是分类标题文本内容
- `d.c` 是分类标题颜色
- `p` 是分类索引
`ItemTips.GetCustomTitleShow`函数会解析这些参数,创建对应的标题布局控件,并返回给调用者。