美文网首页
ToolBar 去掉默认左间距

ToolBar 去掉默认左间距

作者: 黑键手记 | 来源:发表于2019-03-15 10:55 被阅读0次

简单

首先,命名空间使用

  xmlns:app="http://schemas.android.com/apk/res-auto"

这个。目的是使用自己的命名空间。

而android 自己的是这个

  xmlns:android="http://schemas.android.com/apk/res/android"

注意区别。

然后,在我们使用的 ToolBar 中添加属性

     app:contentInsetStart="0dp"

这个属性的中文意思是 插入内容开始的间距,其实就是内容的左间距

那么整个下来是这样的

布局 效果

相关文章

网友评论

      本文标题:ToolBar 去掉默认左间距

      本文链接:https://www.haomeiwen.com/subject/geqlmqtx.html