gpt4 book ai didi

xamarin - 如何在iPhone x中设置安全区域布局

转载 作者:行者123 更新时间:2023-12-03 13:31:58 33 4
gpt4 key购买 nike

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

当前方案:

enter image description here

异常(exception)方案:

enter image description here

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

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 (位于以上链接中的以下行中)。

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

将安全区域设置为真实输出后,如下所示:
enter image description here

请帮助我解决此问题。

问候,
车兰

最佳答案

您可以像这样从XAML进行操作

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

关于xamarin - 如何在iPhone x中设置安全区域布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49293181/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com