none
How to animate content view width in xamarin forms RRS feed

  • Question

  • In content view, I created custom control and try to animate to the width size when clicking the button.

    Animation works well on the content page but animation doesn't work when I try to use the custom control on the content page.

    How can i achieve animation by using content view ?

    Thanks,           
     if (this.titleView != null)
                {
                    double opacity;
    
                    // Animating Width of the search box, from 0 to full width when it added to the view.
                    var expandAnimation = new Animation(
                        property =>
                        {
                            searchEntryBackLayout.WidthRequest = property;
                            opacity = property / titleView.Width;
                            searchEntryBackLayout.Opacity = opacity;
                        }, 0, titleView.Width, Easing.Linear);
                    
                    expandAnimation.Commit(searchEntryBackLayout, "Expand", 16, 250, Easing.Linear, (p, q) => this.SearchExpandAnimationCompleted());
                }
    
    
            private void SearchExpandAnimationCompleted()
               {
                this.searchEntry.Focus();
               }


    Friday, March 13, 2020 10:45 AM

All replies

  • Best place to ask is here

    https://forums.xamarin.com/


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Friday, March 13, 2020 11:40 AM