xamarin.formssegmentedcontrol

Gradient color segmented control in xamarin forms


I need your help.

I want to do gradient background color segmented controls in xamarin forms like this screenshot. How can i do that? Any idea? Thank you.

Screenshot

Alternative link: Alternative link


Solution

  • You can use the PancakeView: https://github.com/sthewissen/Xamarin.Forms.PancakeView

    This View supports rounded corner, shadow and gradients (with start and end color, plus gradient angle).

    You can have a PancakeView for background (with white background, rounded corner and shadow) and inside a StackLayout (or Grid) with two Label "Existing user" and "New user". Every Label with a GestureRecognizer so when is tapped you can display another PancakeView with gradient background between the Label and the PancakeView in background.

    You have to embed everything in a Grid so you can display layers on top eachoter. It could be tricky to micromanage but it is doable without too much effort.