如何在 iPhone x 中设置安全区域布局 [英] How to set Safe Area layout in iPhone x

查看:49
本文介绍了如何在 iPhone x 中设置安全区域布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 Xamarin 表单应用程序,我的应用程序似乎在顶部设置了安全区域.但需要忽略它.

当前场景:

例外情况:

我在谷歌上搜索过这个并获得了以下链接,按照以下链接中所述进行了尝试,但没有任何效果.

请帮我解决这个问题.

问候,雪兰

解决方案

你可以像这样从 XAML 做到这一点

 xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"ios:Page.UseSafeArea="true"

I am developing Xamarin forms app and my app seems with safe area set in top. But need to ignore it.

Current scenario:

Excepted scenario:

I have googled regarding this and got below link, tried out as mentioned in below links and nothing worked.

https://forums.xamarin.com/discussion/104945/iphone-x-and-safe-margins-with-xamarin-forms
https://blog.xamarin.com/making-ios-11-even-easier-xamarin-forms/

But didn’t know how to access SetPrefersLargeTitles under Xamarin forms content page in below line mentioned in above link.

On<Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);

After set safe area as true output come as below,

Please help me to resolve this.

Regards, Cheran

解决方案

You can do it from XAML like this

 xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core" 
ios:Page.UseSafeArea="true"

这篇关于如何在 iPhone x 中设置安全区域布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆