locked
how to change colors for MasterDetail action bar RRS feed

  • Question

  • User217955 posted

    Hi guys, still failing when trying to change background color and text color for action bar in the MasterDetail concept (through PCL). I tried a lot of things (including this https://www.syntaxismyui.com/xamarin-forms-android-actionbar-style-nugget/) and still only "ugly" grey background and black text. So, is it possible to change it? I can imagine that it would have been 2-line change, but makes me crazy unable to resolve :-) Thanks for any hints!

    Monday, August 8, 2016 5:33 PM

Answers

  • User192248 posted

    Hi @czNairik .. Use the following code when setting main page of your app.. Current.MainPage = new NavigationPage(new YourPageName()) { BarBackgroundColor = Color.FromHex("#0E547C"), BarTextColor = Color.White };

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, August 9, 2016 4:28 AM

All replies

  • User192248 posted

    Hi @czNairik .. Use the following code when setting main page of your app.. Current.MainPage = new NavigationPage(new YourPageName()) { BarBackgroundColor = Color.FromHex("#0E547C"), BarTextColor = Color.White };

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, August 9, 2016 4:28 AM
  • User217955 posted

    great! thanks! I've put it here and it's working:

    <?xml version="1.0" encoding="UTF-8"?> <MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TestSpace" x:Class="MySpace.MainPage"> <MasterDetailPage.Master> <local:HamburgerPage x:Name="hamburgerPage" /> </MasterDetailPage.Master> <MasterDetailPage.Detail> <NavigationPage BarBackgroundColor="#0E547C" BarTextColor="White"> <x:Arguments> <local:HomePage /> </x:Arguments> </NavigationPage> </MasterDetailPage.Detail> </MasterDetailPage>

    Tuesday, August 9, 2016 12:02 PM