简体   繁体   中英

How to stop distracting navigation bar animation in Xamarin.Forms/Android?

I have a TabbedPage with four tabs in Xamarin.Forms. The four tab pages each inherit from a common ContentPage with an AbsoluteLayout. When I push to this TabbedPage on Android, the new navigation bar momentarily appears about one-third of the way down the screen then rapidly animates to its proper position at the top of the screen, before other screen elements are displayed. It's very distracting, and even happens (without any text) if I do not set a title at all. Does not happen on iPhone.

How can I prevent this animation?

Edit: Here is a video showing the problem at 0:02, 0:24 and 0:40 : https://drive.google.com/drive/folders/1rHxS_rcVEr8sPC0yujcZf34XvLJ7yJ2K?usp=sharing

Well, the navbar animates from bottom to top of the screen and it stopped midway because I was doing too much on the UI thread in OnAppearing.

Adding a 200ms delay in OnAppearing was one way to avoid it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM