【问题标题】:Xamarin android, how to make navigation bar back button bigger and change color?Xamarin android,如何使导航栏后退按钮变大并改变颜色?
【发布时间】:2016-08-24 15:48:07
【问题描述】:

我正在使用 Xamarin 表单,但我只想为 android 项目制作导航栏后退按钮。我只是想让它变大并改变它的颜色。最好的方法是什么?感谢您的任何回答或建议。

【问题讨论】:

  • 我建议先查找如何在本地执行此操作。然后,您可以了解如何在 Xamarin.Forms 中执行此操作,或者是否存在用于执行此操作的 API。您可以直接查看 Xamarin.Forms 源以获得更多见解:github.com/xamarin/Xamarin.Forms
  • 在Android项目中自定义Actionbar。

标签: xamarin xamarin.android xamarin.forms rendering navigationbar


【解决方案1】:

正如@Rohit 提到的,您将需要自定义样式中的操作栏自定义导航栏的示例如下:

<style name="AppMainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="colorPrimary">#0063a4</item>
    <item name="colorPrimaryDark">#003A63</item>
    <item name="colorAccent">#86c447</item>
    <item name="android:windowBackground">@color/AppBackgroundColor</item>
    <item name="windowActionModeOverlay">true</item>
    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
</style>

博文在这里:https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/

关于导航栏的高度,它可能涉及更多的自定义和导航栏内的自定义视图,这里是一个 android 示例:

https://guides.codepath.com/android/Using-the-App-ToolBar

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-28
    • 2021-11-16
    • 1970-01-01
    • 1970-01-01
    • 2018-06-06
    • 2011-12-17
    • 1970-01-01
    相关资源
    最近更新 更多