Mah*_*dho 2 xamarin.android xamarin xamarin.forms
如何删除多余的突出显示空间或减少空间?
这是我的解决方案,以实现所需的额外空间去除
在我的 droid 项目中,我像这样更改了values/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>
Run Code Online (Sandbox Code Playgroud)
在我的 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>
Run Code Online (Sandbox Code Playgroud)
在我的 droid 项目中,我像这样更改了values/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>
Run Code Online (Sandbox Code Playgroud)
这是最终输出
| 归档时间: |
|
| 查看次数: |
1111 次 |
| 最近记录: |