LinenClipView provides a subclass of
that displays a linen pattern in the clip view like many of Apple's Lion apps. This library can of course be used to display any background image.
In Interface Builder change the Class of an
LNScrollView or similarly change the Class of a
These classes can also be created via code with
To set the pattern image simply call
setPattern on either subclass:
[self.tableScrollView setPattern:[NSImage imageNamed:@"pattern11"]]; [self.webView setPattern:[NSImage imageNamed:@"pattern3"]];
The sample project that ships with this project demonstrates this.
Special thanks to @Dimillian for figuring out how to keep the
[NSGraphicsContext setPatternPhase:]) and @caffeinatedapp for figuring out a fix to the scrollbars on Lion(the complicated
The background patterns included with this project are from @minimalpatterns.
LinenClipView is available under the MIT license. See the LICENSE file for more info.