How to increase the size of the text in suggestions in MaterialSearchView?

做~自己de王妃 提交于 2019-12-11 17:22:13

问题


I've implemented MaterialSearchView in a fragment and it works fine. Now I want to increase the size of the text in suggestions. How can I do that? Thanks!


回答1:


I am not sure if the developers/contributors of this lib has provided an way to do this without the need to fork and edit the lib.

Anyway, for me the easiest way to do what I want is to edit the lib. for your case, if you want edit the text attributes of the textview of suggestions, you may fork the lib and edit the layout named suggest_item as it is the layout used by the adapter that shows the suggestions.

Links this and this


if this does not suit you, you can always add new issue and/or question to the developers/contributors of the lib on the their repo's issue tracker on github, follow this link


EDIT: for your question in comments on how to handle click on suggestions:

The developers/contributors of the lib has provided a public method that you can use to add a click listener, it is named setOnItemClickListener

See this for full method code



来源:https://stackoverflow.com/questions/55322954/how-to-increase-the-size-of-the-text-in-suggestions-in-materialsearchview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!