mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
Merge pull request #194 from NativeScript/feature/ios-navbar-layout-fix
Request layout when showing/hiding the navbar
This commit is contained in:
@ -71,20 +71,28 @@ export class Frame extends frameCommon.Frame {
|
||||
}
|
||||
|
||||
public updateNavigationBar(page?: pages.Page): void {
|
||||
var previousValue = !!this._ios.showNavigationBar;
|
||||
var newValue: boolean = false;
|
||||
switch (this._ios.navBarVisibility) {
|
||||
case enums.NavigationBarVisibility.always:
|
||||
this._ios.showNavigationBar = true;
|
||||
newValue = true;
|
||||
break;
|
||||
|
||||
case enums.NavigationBarVisibility.never:
|
||||
this._ios.showNavigationBar = false;
|
||||
newValue = false;
|
||||
break;
|
||||
|
||||
case enums.NavigationBarVisibility.auto:
|
||||
var pageInstance: pages.Page = page || this.currentPage;
|
||||
this._ios.showNavigationBar = this.backStack.length > 0 || (pageInstance && pageInstance.optionsMenu.getItems().length > 0);
|
||||
newValue = this.backStack.length > 0 || (pageInstance && pageInstance.optionsMenu.getItems().length > 0);
|
||||
newValue = !!newValue; // Make sure it is boolean
|
||||
break;
|
||||
}
|
||||
|
||||
this._ios.showNavigationBar = newValue;
|
||||
if (previousValue !== newValue) {
|
||||
this.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
public get ios(): iOSFrame {
|
||||
|
Reference in New Issue
Block a user