BarBackgroundColor Refusing to get set on Android but BarTextColor is fine.

SkiaSkia USMember ✭✭

On iOS BarBackgroundColor and BarTextColor work as expected but now working on the Android side BarBackgroundColor is not getting set.

Does anyone have any thoughts as to why this could happen?

I've tried both setting the style and setting the property directly in the Navigation Class but neither work.

Answers

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai
  • SkiaSkia USMember ✭✭

    Correct, that is exactly what I'm referring to.
    Attempting the solution there also does not work.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Can you share any relevant code and/or screenshots displaying the problem?

  • SkiaSkia USMember ✭✭

    @JonDouglas said:
    Can you share any relevant code and/or screenshots displaying the problem?

    As far as I'm aware I can't currently but I assure you I've done the exact same syntax as the example.
    I've set it via style as well and I've set it via the properties directly.

    There is nothing to see other than the Navigation bar refusing to change color, although text will change just fine.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Without any sample code or screenshots depicting what you're running into, it might be very hard to help out further.

    A few things to consider:

    1. Are you on the latest version of Xamarin.Forms?
    2. What version of Android are you testing this against? (The device version)
    3. Have you tried this on emulators as well with differing API versions?
  • SkiaSkia USMember ✭✭
    edited February 13

    @JonDouglas said:
    Without any sample code or screenshots depicting what you're running into, it might be very hard to help out further.

    A few things to consider:

    1. Are you on the latest version of Xamarin.Forms?
    2. What version of Android are you testing this against? (The device version)
    3. Have you tried this on emulators as well with differing API versions?
    1. Yes latest stable.
    2. 6.0 Actual Hardware
    3. 6.0/7.0 Simulated Hardware.

    I realize this but I'm doing nothing fancy here. Just straight classic implementation of Navigation.
    Again it works on iOS, android does not though.

  • SkiaSkia USMember ✭✭
    edited February 13

    Solved it by using

    Theme.AppCompat.NoActionBar

    EDIT: Scratch that still have the issue. All it did was change the color to black but I still can't control it's color.

  • DaveUDaveU GBMember ✭✭

    @Skia Did you ever manage to resolve this?

  • SapnaJainSapnaJain USMember ✭✭

    @Skia: Have you got solution for this? I am facing the same issue with android.. :neutral:

  • AceCoderLauraAceCoderLaura AUMember ✭✭

    This is a bug in XF if you're using the FormsAppCompatActivity.

    The workaround is to set android:background in your applications' layout file used for FormsAppCompatActivity.ToolbarResource.

    Set this value to anything, example: android:background="#00000000"

    Then XF will style it with whatever colour is in your XAML style later.

    Really dumb bug, hope it gets sorted soon.

Sign In or Register to comment.