Solve the problem of blank space on the left of custom toolbar and action bar after Android v7
As shown in the figure:
1. View the parent topic of the widget.appcompat.toolbar as follows:
The attribute contentinsetstart is the reason why the custom actionbar cannot be completely filled.
resolvent:
Define a new style in styles.xml, which inherits from widget.appcompact.toolbar as follows:
Then rewrite the toolbar attribute in apptheme in your style.xml:
2. There is another solution:
Write directly to the layout as follows:
App: contentinsetstart = "0.0dp"
The above is what Xiaobian introduced to you. After Android V7, there is a blank space on the left side of the custom toolbar and action bar. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!