How can i do a fill animation in Xamarin.Forms

825 views Asked by At

I need to fill up an polygon with Xamarin.Forms. Imagine a square and fill it with some color with animation.

1

There are 1 answers

0
Daniel Luberda On BEST ANSWER

The easiest thing you can do is to use a BoxView view with Opacity set to zero and Color set to your desired color. Then do the animation with yourBoxView.FadeTo or yourBoxView.TranslateTo method.

If you need a border you have to make a custom render for a ContentView with border support and then put your BoxView inside it or you can use FrameView (rounded corners). http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/

This does something very similar: https://www.youtube.com/watch?feature=player_embedded&v=55r1wHdOLBo