如何删除多余的突出显示空间或减少空间?
答案 0 :(得分:0)
这是我的解决方案,可实现所需的额外空间移除
在我的机器人项目中,我已经改变了价值观/ styles.xml这样
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="android:colorPressedHighlight">@color/ListViewSelected</item>
<item name="android:colorLongPressedHighlight">@color/ListViewHighlighted</item>
<item name="android:colorFocusedHighlight">@color/ListViewSelected</item>
<item name="android:colorActivatedHighlight">@color/ListViewSelected</item>
<item name="android:activatedBackgroundIndicator">@color/ListViewSelected</item>
</style>
<style name="homeToolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
<item name="titleTextColor">@color/primary</item>
<item name="windowActionModeOverlay">true</item>
<item name="contentInsetLeft">12dp</item>
<item name="contentInsetStart">12dp</item>
<item name="contentInsetStartWithNavigation">0dp</item>
<item name="android:paddingLeft">10dp</item>
</style>
<style name="homeToolbarNavigationButtonStyle"
parent="@style/Widget.AppCompat.Toolbar.Button.Navigation">
<item name="android:minWidth">0dp</item>
<item name="android:paddingRight">10dp</item>
<item name="android:scaleType">centerInside</item>
</style>
</resources>
在我的droid项目中,我已经像这样更改了values-v21 / styles.xml
<resources>
<style name="MyTheme" parent="MyTheme.Base">
<item name="toolbarStyle">@style/homeToolbarStyle</item>
<item
name="toolbarNavigationButtonStyle">@style/homeToolbarNavigationButtonStyle</item>
</style>
<style name="homeToolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
<item name="titleTextColor">@color/primary</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="android:contentInsetLeft">12dp</item>
<item name="android:contentInsetStart">12dp</item>
<item name="android:textColorSecondary">@color/primary</item>
<item name="contentInsetStartWithNavigation">0dp</item>
<item name="android:paddingLeft">10dp</item>
</style>
<style name="homeToolbarNavigationButtonStyle"
parent="@style/Widget.AppCompat.Toolbar.Button.Navigation">
<item name="android:minWidth">0dp</item>
<item name="android:scaleType">centerInside</item>
<item name="android:paddingRight">0dp</item>
</style>
</resources>
在我的机器人项目中,我已经改变值/ color.xml这样
<resources>
<color name="primary">#ED1C22</color>
<color name="primaryDark">#9b0000</color>
<color name="accent">#ED1C22</color>
<color name="window_background">#FAFAFA</color>
<color name="ListViewSelected">#EEEEEE</color>
<color name="ListViewHighlighted">#EEEEEE</color>
</resources>
这是最终输出