2

I have a .Net Maui project and I want a structure that stands just above the NavigationView at the bottom, as in music applications such as Apple Music, and moves up simultaneously as I drag it upwards with my hand, but I couldn't find how to do it.

Apple Music

Animation

End

My App

So far, I have created this opening section with a page that opens upwards with a simple event trigger, but it does not follow my hand and does not look good. Is it possible to use bottom sheets? If possible, is it possible to launch it from just above the Navigation View instead of from the bottom of the page?

Some codes that I tried but did not work(Another Project): Bottom Bar:

<AbsoluteLayout>
    <BoxView Color="Teal"  HeightRequest="200"  x:Name="monster">
        <BoxView.GestureRecognizers>
            <PanGestureRecognizer PanUpdated="PanGestureRecognizer_PanUpdated" />

        </BoxView.GestureRecognizers>
    </BoxView>
</AbsoluteLayout>

Main Page:

 <cc:BottomPage HeightRequest="100" Grid.Row="1" toolkit:DockLayout.DockPosition="Bottom"/>
3
  • You can use the gesture. Commented Dec 17, 2024 at 1:25
  • Although I tried, I was not successful. If you could give me more details, I would be very happy. Commented Dec 31, 2024 at 19:48
  • The boxview is the control you want to drag, and this testpage is the page to be displayed. Here you can drag your finger up and down the boxview. Commented Jan 2 at 9:16

1 Answer 1

0

Here is my solution.

-----update----- TestPage.xaml

<AbsoluteLayout>
               <BoxView Color="Teal"  HeightRequest="200" WidthRequest="200"  x:Name="monster">
    <BoxView.GestureRecognizers>
        <PanGestureRecognizer PanUpdated="OnPanUpdated" />

    </BoxView.GestureRecognizers>
</BoxView>
           </AbsoluteLayout>

TestPage.xaml.cs

 double tempx = 0;
 double tempy = 0; 
 void OnPanUpdated(object sender, PanUpdatedEventArgs e)
 {
     switch (e.StatusType)
     {
         case GestureStatus.Started:
             tempx = monster.TranslationX;
             tempy = monster.TranslationY;
             break;
         case GestureStatus.Running:
             monster.TranslationY = e.TotalY + tempy;
             break;
         case GestureStatus.Completed:
             tempy = monster.TranslationY;
             break;
     }
 }
Sign up to request clarification or add additional context in comments.

5 Comments

Thank you, but that's not what I'm looking for. It has to go up simultaneously with my hand.
@SalihEtkaAkagündüz I have updated my answer, please give it a try.For more information , please refer to PanGestureRecognizer.
Sorry for returning late. Yes, it goes up as I want, but it can only go up to the height of the structure (100 px), I want it to cover the entire screen.
I have updated the answer, and it worked. Please give it a try.@SalihEtkaAkagündüz
I opened another project and did what you said, but I guess it didn't work. When I used the structure you mentioned, it covered the entire page, so I added HeightRequest="100" expression to the structure on the Main Page, but BoxView does not appear and OnPanUpdated does not trigger. Thank you very much for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.