在ActionMode中删除工具栏标题边距

时间:2020-06-03 11:22:00

标签: java android toolbar android-actionmode

我希望删除导航图标和actionMode标题之间的空格。由于以下原因,我设法将其从工具栏中删除:

<style name="AppTheme" parent="Theme.MaterialComponents.Light">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorPrimary</item>
        <item name="toolbarStyle">@style/cusToolbarStyle</item>
</style>

<style name="cusToolbarStyle" parent="@style/Widget.MaterialComponents.Toolbar">
        <item name="titleMargin">0dp</item>
        <item name="contentInsetStartWithNavigation">0dp</item>
        <item name="contentInsetStart">0dp</item>
        <item name="android:background">@color/white</item>
</style>

enter image description here

但是我无法更改模式操作来删除照片上的空间: enter image description here

1 个答案:

答案 0 :(得分:0)

好的,这很复杂而且很困难,但是我使用了LayoutInspector,如向我建议的@cgb_pandey。因此,我找到了关闭ImageView的系统标识符,并将以下代码添加到onPrepareActionMode方法中:

height