Check if Element parent is null before getting the padding insets (#5757)
* Check if Element parent is null before getting the padding insets * - move if up earlier
This commit is contained in:
Родитель
eac5e45be7
Коммит
5f9bf9d8c4
|
@ -242,7 +242,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
void UpdateUseSafeArea()
|
||||
{
|
||||
if (!Forms.IsiOS11OrNewer) return;
|
||||
if (!Forms.IsiOS11OrNewer)
|
||||
return;
|
||||
|
||||
if (!UsingSafeArea)
|
||||
{
|
||||
|
@ -258,7 +259,14 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
void UpdateShellInsetPadding()
|
||||
{
|
||||
var setInsets = Shell.GetSetPaddingInsets(Element) || Shell.GetSetPaddingInsets(Element?.Parent);
|
||||
if (Element == null)
|
||||
return;
|
||||
|
||||
var setInsets = Shell.GetSetPaddingInsets(Element);
|
||||
|
||||
if (!setInsets && Element.Parent != null)
|
||||
setInsets = Shell.GetSetPaddingInsets(Element.Parent);
|
||||
|
||||
if (setInsets)
|
||||
{
|
||||
nfloat topPadding = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче