Update ShellSectionRenderer.cs (#18945)
* Update ShellSectionRenderer.cs Fix crash navigating in Shell and trying to get the navbar visibility * Apply suggestions from code review * Update src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs --------- Co-authored-by: gc <gc@keba.com> Co-authored-by: Gerald Versluis <gerald@verslu.is>
This commit is contained in:
Родитель
8c370bdc0c
Коммит
b39cd8afe4
|
@ -724,11 +724,15 @@ namespace Microsoft.Maui.Controls.Platform.Compatibility
|
|||
{
|
||||
var element = _self.ElementForViewController(viewController);
|
||||
|
||||
bool navBarVisible;
|
||||
if (element is ShellSection)
|
||||
navBarVisible = _self._renderer.ShowNavBar;
|
||||
else
|
||||
navBarVisible = Shell.GetNavBarIsVisible(element);
|
||||
bool navBarVisible = false;
|
||||
|
||||
if (element is not null)
|
||||
{
|
||||
if (element is ShellSection)
|
||||
navBarVisible = _self._renderer.ShowNavBar;
|
||||
else
|
||||
navBarVisible = Shell.GetNavBarIsVisible(element);
|
||||
}
|
||||
|
||||
navigationController.SetNavigationBarHidden(!navBarVisible, true);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче