toptabbedpage-xamarin-forms icon indicating copy to clipboard operation
toptabbedpage-xamarin-forms copied to clipboard

Support for SafeArea

Open alexmartinezm opened this issue 5 years ago • 7 comments

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.

alexmartinezm avatar Nov 21 '18 10:11 alexmartinezm

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

1mohmmad4 avatar Jun 09 '19 11:06 1mohmmad4

@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"

Wenfengcheng avatar Jun 27 '19 08:06 Wenfengcheng

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

theapphideaway avatar Jul 15 '19 11:07 theapphideaway

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

candidodmv avatar Dec 04 '19 21:12 candidodmv

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

candidodmv avatar Dec 05 '19 10:12 candidodmv

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

image

image

Same problem... Any workaround?

danpadua avatar Aug 21 '20 21:08 danpadua

@danpadua Did you manage to solve the problem?

JotaDobleEse avatar Nov 23 '20 16:11 JotaDobleEse