Align Toolbar title and SearchView with list content with avatars

♀尐吖头ヾ 提交于 2019-12-24 09:49:49

问题


I'm trying to follow the material guidelines and I aligned the Toolbar title with the avatar like the image below following the instructions of @ChrisBanes in this answer.

My issue now is that when the SearchView is activated, it's not aligned anymore as seen in the second image. (It was aligned before changing the inset)

Any ideas of how I can align both things instead of having to choose between one or the other?


回答1:


If you want to align avatar with search-view then you need remove space of homeup button and search-view.

FYI: search view behavior is different in large size device so you can go with custom action-bar.




回答2:


I solved it by using app:titleMarginStart="16dp" instead of changing the contentInset. I have tested it only in a xhdpi phone, though.



来源:https://stackoverflow.com/questions/38998161/align-toolbar-title-and-searchview-with-list-content-with-avatars

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