Code Monkey home page Code Monkey logo

jlnfadingscrollview's Introduction

JLNFadingScrollView
Written by Joshua Nozzi
http://joshua.nozzi.name
========================


What is JLNFadingScrollView?
----------------------------

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).


What platforms does it support?
-------------------------------

Requires 10.5 and up, because that's when NSGradient was introduced. You could use other gradient techniques to support older OS versions but really ... why bother?


What are the licensing requirements?
------------------------------------

See the license document (License.txt) that is included with the source code. It is free to use but requires attribution. Feel free to contact me at [email protected] with any licensing questions.


How do I use it in my project?
------------------------------

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.


What else do I need to know?
----------------------------

1 - This subclass does not get along with NSClipView's copy-on-scroll behavior and sets it to NO. If you turn it back on, you'll get drawing artifacts. 
2 - The top fade cannot be seen when table/outline column headers are enabled. It would look weird anyway...
3 - The fades auto-adjust their size depending on the chosen border type. Overridden border drawing or newly added border types may not adjust correctly.


How can I reach you?
--------------------

You can e-mail me at [email protected]. I'm happy to answer most questions about this source code but am not willing to "hold your hand" or debug your code. It's straightforward to use if you are familiar with Cocoa and take a few moments to study the source. Please do your homework first. Questions sent to me that make it obvious the sender didn't do their homework will be ignored.

jlnfadingscrollview's People

Contributors

jnozzi avatar

Watchers

StuFF mc avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.