Next Page > Hide TOC

CAScrollLayer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QuartzCore.framework
Availability
Available in Mac OS X v10.5 and later.
Declared in
CAScrollLayer.h
Companion guides
Related sample code

Overview

The CAScrollLayer class is a subclass of CALayer that simplifies displaying a portion of a layer. The extent of the scrollable area of the CAScrollLayer is defined by the layout of its sublayers. The visible portion of the layer content is set by specifying the origin as a point or a rectangular area of the contents to be displayed. CAScrollLayer does not provide keyboard or mouse event-handling, nor does it provide visible scrollers.

Tasks

Scrolling Constraints

Scrolling the Layer

Properties

For more about Objective-C properties, see “Properties” in The Objective-C 2.0 Programming Language.

scrollMode

Defines the axes in which the layer may be scrolled.

@property(copy) NSString *scrollMode

Discussion

The possible values are described in “Scroll Modes”. The default is kCAScrollBoth.

Availability
Declared In
CAScrollLayer.h

Instance Methods

scrollToPoint:

Changes the origin of the receiver to the specified point.

- (void)scrollToPoint:(CGPoint)thePoint

Parameters
thePoint

The new origin.

Availability
Declared In
CAScrollLayer.h

scrollToRect:

Scroll the contents of the receiver to ensure that the rectangle is visible.

- (void)scrollToRect:(CGRect)theRect

Parameters
theRect

The rectangle that should be visible.

Availability
Related Sample Code
Declared In
CAScrollLayer.h

Constants

Scroll Modes

These constants describe the supported scroll modes used by the scrollMode property.

NSString * const kCAScrollNone;
NSString * const kCAScrollVertically;
NSString * const kCAScrollHorizontally;
NSString * const kCAScrollBoth;

Constants
kCAScrollNone

The receiver is unable to scroll.

Available in Mac OS X v10.5 and later.

Declared in CAScrollLayer.h.

kCAScrollVertically

The receiver is able to scroll vertically.

Available in Mac OS X v10.5 and later.

Declared in CAScrollLayer.h.

kCAScrollHorizontally

The receiver is able to scroll horizontally.

Available in Mac OS X v10.5 and later.

Declared in CAScrollLayer.h.

kCAScrollBoth

The receiver is able to scroll both horizontally and vertically.

Available in Mac OS X v10.5 and later.

Declared in CAScrollLayer.h.

Declared In
CAScrollLayer.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-24)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.