Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Thumb switch has disappeared in Android after update Xamarin.Forms from 2.5 to 4.5

After updating Xamarin.Forms the Switch's look like this:
off: on:

This is the code:

_check = new Switch
{
    VerticalOptions = LayoutOptions.Center
}

In the style.xml file I have the key: @color/AccentColor
And in colors.xml I have: #FFDA125F

If I add ThumbColor property:

_check = new Switch
{
    VerticalOptions = LayoutOptions.Center,
    ThumbColor = Color.FromHex("#f1f1f1")
}

The Switch's look like this:
off: on:

But I want this looks like:

I don't know why that happened after the update. Does anyone have any idea what could be happening?

Best Answer

  • RumbosNRumbosN Member
    Accepted Answer

    I found the solution.

    I was using UXDivers.Artina theme and in AssemblyInfo I had this line:
    [assembly: ExportRenderer(typeof(Switch), typeof(UXDivers.Artina.Shared.ArtinaSwitchRenderer))]

    I only removed this and ready

Answers

  • RumbosNRumbosN Member
    Accepted Answer

    I found the solution.

    I was using UXDivers.Artina theme and in AssemblyInfo I had this line:
    [assembly: ExportRenderer(typeof(Switch), typeof(UXDivers.Artina.Shared.ArtinaSwitchRenderer))]

    I only removed this and ready

Sign In or Register to comment.