Xcode/iOS: How to hide Navigation- AND ToolBar on scroll down?

前端 未结 4 984
执笔经年
执笔经年 2020-12-23 23:41

I would like to hide both bars on scroll down on my iPhone. When I scroll up, they should appear again.. How can I handle this?

4条回答
  •  天命终不由人
    2020-12-24 00:30

    You might check this, available from iOS8, i think this is the reverse of what you are looking for...but worth checking as it is something standard and this is how Safari works.

    Swift

    var hidesBarsOnSwipe: Bool

    Objective-C

    @property(nonatomic, readwrite, assign) BOOL hidesBarsOnSwipe Discussion

    When this property is set to YES, an upward swipe hides the navigation bar and toolbar. A downward swipe shows both bars again. If the toolbar does not have any items, it remains visible even after a swipe. The default value of this property is NO.

提交回复
热议问题