IndexBar遇到的问题汇总,希望有人能给解答!!!
1:没办法设置显示字体大小
2:IndexBarExpandedStatus没有展开折叠的监听
3:setSelectedCallback 设置无效
代码如下:
IndexBar indexBar = (IndexBar) findComponentById(ResourceTable.Id_indexBar);
String[] strs = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
indexBar.setIndexRadius(AttrHelper.vp2px(120, this));
indexBar.setIndexString(strs, getColorPaint(Color.WHITE));
indexBar.setMinCountAndMaxCount(0, strs.length);
indexBar.setIndexPaint(getColorPaint(Color.TRANSPARENT));
indexBar.setIndexBarExpandedStatus(false);
indexBar.setSelectedCount(0);
indexBar.setStringSelectedPaint(getColorPaint(Color.RED));
indexBar.setSelectedCallback(i ->
HiLog.info(label, "onSelected=%{public}d", i)
);
字体大小已经解决