contentInsetLeft无法在工具栏上运行

时间:2016-06-29 15:48:18

标签: android android-toolbar

我几乎整天都在寻找stackoverflow上这个问题的解决方案,但我找不到解决方案。

我有一个这样构建的自定义工具栏:

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#00a7e0"
    android:contentInsetLeft="0dp"
    android:contentInsetStart="0dp"
    app:contentInsetLeft="0dp"
    app:contentInsetStart="0dp"
    android:contentInsetRight="0dp"
    android:contentInsetEnd="0dp"
    app:contentInsetRight="0dp"
    app:contentInsetEnd="0dp">

现在,我在工具栏上有一个小的左边距,如下所示:

Screenshot of toolbar

现在应该可以使用contentInsetLeft(或-Start)删除此左边距,这已经包含在工具栏的xml中。不幸的是,左边距仍然在运行Android 6.0的Samsung S7上。我尝试了所有可能的解决方案,但它并没有改变。奇怪的是,在使用Android 4.1.2的旧设备上运行应用程序时,左边距会消失。

有人有解决方案吗?

编辑:我可能不得不提一下,我正在使用Ionic Framework作为应用程序的核心。我正在开发一个Ionic插件,它是原生的android。

0 个答案:

没有答案