Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SafeArea #24

Open
alexmartinezm opened this issue Nov 21, 2018 · 7 comments
Open

Support for SafeArea #24

alexmartinezm opened this issue Nov 21, 2018 · 7 comments

Comments

@alexmartinezm
Copy link

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
Copy link

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

@Wenfengcheng
Copy link

@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
Copy link

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

@candidodmv
Copy link

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

@candidodmv
Copy link

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

@danpadua
Copy link

danpadua commented Aug 21, 2020

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

image

image

Same problem...
Any workaround?

@JotaDobleEse
Copy link

@danpadua
Did you manage to solve the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants