I have a ListView of TextViews and to highlight one of these, I want to make the TextView bold. This only works if I don't scroll the ListView. After I scroll, the boldness changes to a different position. Does anyone know why, or how I can solve this problem?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It may be problem with ListView, because listview reuses view items (and puts content inside them), if you are using convertView feature. It's hard to say without seeing your code where it goes wrong. You could try using Html class to handle the boldness of required items:
txt.setText(Html.fromHtml('<b>Text that requires bold</b>'));
回答2:
Not right offhand. I would recommend posting some code; the problem sounds like it may be in your implementation