Xamarin.Forms animations

Xamarin.Forms has multiple functions for animating views. We have access to the following functions:

  • FadeTo: This is used to animate opacity (that is, fade in/out).
  • RotateTo: This is used to animate rotations.
  • ScaleTo: This is used to animate size.
  • TranslateTo: This is used to animate (x, y) positions.
  • LayoutTo: This is used to animate x, y, width, and height.

Tip

Stay away from the LayoutTo function. Jason Smith (the creator of Xamarin.Forms) recommends you stick with the TranslateTo instead. The issue with LayoutTo is the parent of the view you are calling LayoutTo on will not be aware of the translation/resize that happened and will simply overwrite it at the next layout cycle (like when you rotate the device). This is because ...

Get Xamarin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.