NAXAM / toptabbedpage-xamarin-forms

TopTabbedPage - A Xamarin.Forms page for showing tabs at top on iOS
Apache License 2.0
81 stars 24 forks source link

Support for SafeArea #24

Open alexmartinezm opened 5 years ago

alexmartinezm commented 5 years ago

Hello,

I have seen that there is no support for SafeArea, required by iPhone X, Xs, and so on. To achieve this, I have set the top SafeAreaInsets like this:

var marginTop = UIApplication.SharedApplication.Windows[0].SafeAreaInsets.Top;

Then, maringTop should be applied in the first VisualFormat constraint, specifically on TopTabbedRenderer.

The constraint would look like this:

View.AddConstraints(NSLayoutConstraint.FromVisualFormat($"V:|-{marginTop}-[tabbar]-0-[content]-0-|", 0, null, views));

I hope that you can include this on the next release.

Regards, Àlex MM.

1mohmmad4 commented 5 years ago

please can provide me all code kindly for ios renderer to fix safe area

Wenfengcheng commented 5 years ago

@1mohmmad4 Maybe you can use safe area layout to fix this problem.

xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true"
theapphideaway commented 5 years ago

Ive tried using Safe Area Layout but for some reason it is still cut off.

candidodmv commented 4 years ago

Hello, @tuyen-vuduc could you add the above code snippet, safe area is too much important nowadays. Thank you

candidodmv commented 4 years ago

Hello, @alexmartinezm . Your above approach treat only safe area for the top, but for the bottom also needs to be considered. Thanks

danpadua commented 4 years ago

I've tried using ios:UseSageArea="True", but don't work in TopTabbedPage, see image:

image

image

Same problem... Any workaround?

JotaDobleEse commented 3 years ago

@danpadua Did you manage to solve the problem?