Skip to content

A UIScrollView subclass that fades the leading and/or trailing edges of a scroll view to transparent.

License

Notifications You must be signed in to change notification settings

stephsharp/SSFadingScrollView

Repository files navigation

#SSFadingScrollView

A UIScrollView subclass that fades the leading and/or trailing edges of a scroll view to transparent. It animates the gradient in and out based on the current content offset, and uses a mask to fade the scroll view content without also fading the scroll bars.

SSFadingScrollView screenshots

##Features

  • Fade top and/or bottom of vertical scroll view
  • Fade left and/or right of horizontal scroll view
  • Animated fade in and out (based on content offset) with customizable duration
  • Adjustable gradient size
  • Scroll bars don't fade out with the scroll view content
  • IBInspectable properties allow you to set up your fading scroll view entirely in Interface Builder. (See the demo project for an example.)

##Properties

#####fadeLeadingEdge

Fade leading edge of fade axis. Default is YES.

#####fadeTrailingEdge

Fade trailing edge of fade axis. Default is YES.

#####fadeSize

Size of gradient. Default is 30.

#####fadeDuration

Duration of fade in & out. Default is 0.3 seconds.

#####maskScrollBars

Default is YES. Scroll bars are masked so they don't fade with the scroll view content. Set to NO to fade out the scroll bars along with the content.

##Installation

###CocoaPods

To install via CocoaPods, add to your podfile:

pod 'SSFadingScrollView', '~> 1.1'

##Acknowledgements

With thanks to:

Photos in the demo project were sourced from Unsplash.

##License

SSFadingScrollView is released under the MIT license. See LICENSE for details.

About

A UIScrollView subclass that fades the leading and/or trailing edges of a scroll view to transparent.

Resources

License

Stars

Watchers

Forks

Packages

No packages published