Skip to content

UINavigationController:hidesBarsOnTap 属性 ​

hidesBarsOnTap 属性决定点一下页面就切换导航条和工具条的显示。

值 ​

布尔值。

取值效果
true点一下页面,导航条和工具条藏起来;再点一下,它们再出现。未在模拟器验证
false点页面不影响导航条

写错时 ​

不抛异常。写入的值照 JS 的真假转换:0、''、null、undefined 得到 false,其余得到 true。

示例 ​

js
const nav = new UINavigationController(new UIViewController());
nav.hidesBarsOnTap = true;
console.log(nav.hidesBarsOnTap);

效果:控制台输出 true。之后点一下页面,导航条藏起来。藏起的效果未在模拟器验证。

对应的 iOS API ​

UINavigationController.hidesBarsOnTap。

参见 ​