Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Looking to animate transition between tabs of UITabBarController.

$
0
0

Folks, need some help here. Just can't figure this out. Does anyone have an example of some code that animates the transition between two tabs of a UITabBarController?

I am looking to use a swipe gesture to allow people to change tabs. I have the swipe working, but it just changes to the next tab with no animation. In each ViewController assigned to the UITabBarController I have the following code for Left and Right swipe gestures.

protected void HandleLeftSwipe(UISwipeGestureRecognizer recognizer)
{
    if (this.TabBarController.SelectedIndex != 4) {
        this.TabBarController.SelectedIndex = this.TabBarController.SelectedIndex + 1;
    }
}

protected void HandleRightSwipe(UISwipeGestureRecognizer recognizer)
{
    if (this.TabBarController.SelectedIndex != 0) {
        this.TabBarController.SelectedIndex = this.TabBarController.SelectedIndex - 1;
    }
}

This is one part of iOS programming that still eludes me. Hoping someone can shed some light on this. Thanks! Bob


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>