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

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

问题描述

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

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

当前情况:

例外情况:

我对此进行了搜索,并获得了下面的链接,如下面的链接所述进行了尝试,但没有任何效果.

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/

但是不知道如何访问Xamarin表单内容页面下的 SetPrefersLargeTitles (位于以上链接中的以下行中).

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.

关于, Cheran

Regards, Cheran

推荐答案

请参考使用Xamarin.Forms使iOS 11更加轻松

我们使用特定于平台的实施.

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

iOS 11或更高版本

var safeInsets  = On<Xamarin.Forms.PlatformConfiguration.iOS>().SafeAreaInsets();
safeInsets.Left = 24;
this.Padding = safeInsets;

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

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