JLNFadingScrollView

The JLNFadingScrollView project is a simple drop-in Objective-C / Cocoa NSScrollView subclass that provides a visual fade effect at the top and bottom of scrolled content, giving a visual sense of the content fading as it nears the top or bottom edge. Several examples of various fade height and color configurations are below.

 

Details

JLNFadingScrollView is a drop-in subclass of NSScrollView that adds a top and bottom fade of scrolled content (a la Dictionary.app’s left-hand term source list). You can configure its fade color (usually a gray/black for shadow or the scroll view’s background color for ‘fade-to-nothing’) and the fade height (small for shadow look, very large for iPhone-style-rolling-wheel effect).

Usage

  1. Copy JLNFadingScrollView.m and JLNFadingScrollView.h into your project.
  2.  In Interface Builder, set the class name of the desired NSScrollView to JLNFadingScrollView.
  3. Include JLNFadingScrollView.h into any file in which you want to communicate with the scroll view (to configure its fade color/height).
  4. Call -setFadeColor: and/or -setFadeHeight: to configure to taste

License

This source code is free to use in any private, public, or commercial software products with attribution. See License.txt that accompanies the source file for details.

Source

The code is hosted entirely on Github. Click here to visit the repository.

© Joshua Nozzi. All rights reserved.