Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Display Tabbed Page in top in Xamarin.iOS

$
0
0

Hello everyone,

I need to create the tabbed menu as per Youtube's latest UI to show the menu in top in android and iOS.

The android default default behavior is to show menu on top so that's working fine.

In iOS I have created a custom render and I am using following code to change the position of bar to top:

    UIInterfaceOrientation orientation = UIApplication.SharedApplication.StatusBarOrientation;

        if (UIInterfaceOrientation.LandscapeLeft == orientation || UIInterfaceOrientation.LandscapeRight == orientation)
        {
            tabSize = 32.0f;
        }

        CGRect tabFrame = this.TabBar.Frame;

        tabFrame.Height = tabSize;

        tabFrame.Y = this.View.Frame.Y;

        this.TabBar.Frame = tabFrame;
        this.TabBar.ContentMode = UIViewContentMode.ScaleToFill;

        // Set the translucent property to NO then back to YES to
        // force the UITabBar to reblur, otherwise part of the
        // new frame will be completely transparent if we rotate
        // from a landscape orientation to a portrait orientation.

        this.TabBar.Translucent = false;
        this.TabBar.Translucent = true;
        //this.TabBar.Translucent = false;
        this.TabBar.SetNeedsUpdateConstraints();

Now my problem is there is some white space in bottom for leaving space for bar which is already moved to top.

Does any one knows how to fix this?

This problem is also in following post but I am not able to find answer.

https://forums.xamarin.com/discussion/comment/226114/#Comment_226114


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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