CAScrollLayer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QuartzCore.framework
Availability
Available in 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

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
  • Available in OS X v10.5 and later.
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
  • Available in OS X v10.5 and later.
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
  • Available in OS X v10.5 and later.
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 OS X v10.5 and later.

Declared in CAScrollLayer.h.

kCAScrollVertically

The receiver is able to scroll vertically.

Available in OS X v10.5 and later.

Declared in CAScrollLayer.h.

kCAScrollHorizontally

The receiver is able to scroll horizontally.

Available in OS X v10.5 and later.

Declared in CAScrollLayer.h.

kCAScrollBoth

The receiver is able to scroll both horizontally and vertically.

Available in OS X v10.5 and later.

Declared in CAScrollLayer.h.

Declared In
CAScrollLayer.h