ios8 导航栏效果一览表

本文深入探讨了iOS开发中UINavigationController的关键属性,包括当键盘出现时如何隐藏导航栏,滑动操作时的导航栏隐藏与显示,以及在垂直尺寸为紧凑状态时的导航栏隐藏机制。同时,文章还介绍了用于触发这些行为的自定义手势识别器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

class UINavigationController : UIViewController {

  

    //... truncated

      

    /// When the keyboard appears, the navigation controller's navigationBar toolbar will be hidden. The bars will remain hidden when the keyboard dismisses, but a tap in the content area will show them.

    @availability(iOS, introduced=8.0)

    var hidesBarsWhenKeyboardAppears: Bool

    /// When the user swipes, the navigation controller's navigationBar & toolbar will be hidden (on a swipe up) or shown (on a swipe down). The toolbar only participates if it has items.

    @availability(iOS, introduced=8.0)

    var hidesBarsOnSwipe: Bool

    /// The gesture recognizer that triggers if the bars will hide or show due to a swipe. Do not change the delegate or attempt to replace this gesture by overriding this method.

    @availability(iOS, introduced=8.0)

    var barHideOnSwipeGestureRecognizer: UIPanGestureRecognizer { get }

    /// When the UINavigationController's vertical size class is compact, hide the UINavigationBar and UIToolbar. Unhandled taps in the regions that would normally be occupied by these bars will reveal the bars.

    @availability(iOS, introduced=8.0)

    var hidesBarsWhenVerticallyCompact: Bool

    /// When the user taps, the navigation controller's navigationBar & toolbar will be hidden or shown, depending on the hidden state of the navigationBar. The toolbar will only be shown if it has items to display.

    @availability(iOS, introduced=8.0)

    var hidesBarsOnTap: Bool

    /// The gesture recognizer used to recognize if the bars will hide or show due to a tap in content. Do not change the delegate or attempt to replace this gesture by overriding this method.

    @availability(iOS, introduced=8.0)

    unowned(unsafe) var barHideOnTapGestureRecognizer: UITapGestureRecognizer { get }

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值