0
votes

I tried to make a ContentPage with a few ContentViews that are growing on tap (And layout its Children!). That was working well with the LayoutTo(...) Method from Xamarin.Forms.ViewExtensions. But I was getting some Issues with that, later I found that Article.
LayoutTo does not really resize the View, the view will reset to its initial position and size on the next LayoutCycle. But I need to size a Small View to Fullscreen and use it like a normal ContentPage (with OnPropertyChanged)

What I tried so far:

  • LayoutTo
  • Forms Animation and set the Height/Width Request (and force Layout Cycle)
  • Custom Renderer with UIView.Animate (and force Layout Cycle)
  • Different Layouts (Absolute and Relative) with all combinations :-/
  • ScaleTo

Has anyone tried similar things in Xamarin.Forms and can give me a hint?

1

1 Answers

0
votes

You can use the ScaleTo method to resize View. Here is an example

async void Animate()
    {
        await Task.Delay (1000);
        await myCustomLabel.ScaleTo (10, 1000);
    }

Above snippet will wait for 1 second intitally then apply a 10x zoom to the UILabel with an animation lasting 1 second