toptabbedpage-xamarin-forms
toptabbedpage-xamarin-forms copied to clipboard
Support for SafeArea
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.
please can provide me all code kindly for ios renderer to fix safe area
@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"
Ive tried using Safe Area Layout but for some reason it is still cut off.
Hello, @tuyen-vuduc could you add the above code snippet, safe area is too much important nowadays. Thank you
Hello, @alexmartinezm . Your above approach treat only safe area for the top, but for the bottom also needs to be considered. Thanks
I've tried using ios:UseSageArea="True"
, but don't work in TopTabbedPage, see image:
Same problem... Any workaround?
@danpadua Did you manage to solve the problem?