将工具栏标题和SearchView与带有化身的列表内容对齐 [英] Align Toolbar title and SearchView with list content with avatars
问题描述
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.
我现在的问题是,当SearchView激活时,它不再对齐,如第二幅图像所示. (在更改插图之前已对齐)
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?
推荐答案
我通过使用app:titleMarginStart="16dp"
而不是更改contentInset来解决了该问题.不过,我仅在xhdpi手机中对其进行了测试.
I solved it by using app:titleMarginStart="16dp"
instead of changing the contentInset. I have tested it only in a xhdpi phone, though.
这篇关于将工具栏标题和SearchView与带有化身的列表内容对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!