Class: CATextLayer
Overview
The CATextLayer provides simple text layout and rendering of plain or attributed strings. The first line is aligned to the top of the layer.
Instance Attribute Summary (collapse)
-
- alignmentMode
Determines how individual lines of text are horizontally aligned within the receiver’s bounds.
-
- font
The font used to render the receiver’s text.
-
- fontSize
The font size used to render the receiver’s text.
-
- foregroundColor
The color used to render the receiver’s text.
-
- string
The text to be rendered by the receiver.
-
- truncationMode
Determines how the text is truncated to fit within the receiver’s bounds.
-
- wrapped
Determines whether the text is wrapped to fit within the receiver’s bounds.
Attributes inherited from CALayer
#actions, #anchorPoint, #anchorPointZ, #backgroundColor, #backgroundFilters, #borderColor, #borderWidth, #bounds, #compositingFilter, #contents, #contentsCenter, #contentsGravity, #contentsRect, #contentsScale, #cornerRadius, #delegate, #doubleSided, #drawsAsynchronously, #edgeAntialiasingMask, #filters, #frame, #geometryFlipped, #hidden, #magnificationFilter, #mask, #masksToBounds, #minificationFilter, #minificationFilterBias, #name, #needsDisplayOnBoundsChange, #opacity, #opaque, #position, #rasterizationScale, #shadowColor, #shadowOffset, #shadowOpacity, #shadowPath, #shadowRadius, #shouldRasterize, #style, #sublayerTransform, #sublayers, #superlayer, #transform, #visibleRect, #zPosition
Method Summary
Methods inherited from CALayer
#actionForKey:, #addAnimation:forKey:, #addSublayer:, #affineTransform, #animationForKey:, #animationKeys, #containsPoint:, #contentsAreFlipped, #convertPoint:fromLayer:, #convertPoint:toLayer:, #convertRect:fromLayer:, #convertRect:toLayer:, #convertTime:fromLayer:, #convertTime:toLayer:, defaultActionForKey:, defaultValueForKey:, #display, #displayIfNeeded, #drawInContext:, #hitTest:, #init, #initWithLayer:, #insertSublayer:above:, #insertSublayer:atIndex:, #insertSublayer:below:, layer, #layoutIfNeeded, #layoutSublayers, #modelLayer, #needsDisplay, needsDisplayForKey:, #needsLayout, #preferredFrameSize, #presentationLayer, #removeAllAnimations, #removeAnimationForKey:, #removeFromSuperlayer, #renderInContext:, #replaceSublayer:with:, #scrollPoint:, #scrollRectToVisible:, #setAffineTransform:, #setNeedsDisplay, #setNeedsDisplayInRect:, #setNeedsLayout, #shouldArchiveValueForKey:
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (String) alignmentMode
Determines how individual lines of text are horizontally aligned within the receiver’s bounds. The possible values are described in “Horizontal alignment modes”. Defaults to kCAAlignmentNatural.
- (CFTypeRef) font
The font used to render the receiver’s text. May be either a CTFontRef, a CGFontRef, an instance of NSFont (OS X only), or a string naming the font. In iOS, you cannot assign a UIFont object to this property. Defaults to Helvetica. The font property is only used when the string property is not an NSAttributedString.Note: If the font property is a CTFontRef, a CGFontRef, or an instance of NSFont, the font size of the property is ignored.
- (Float) fontSize
The font size used to render the receiver’s text. Animatable. Defaults to 36.0.The fontSize property is only used when the string property is not an NSAttributedString.Note: Implicit animation of this property is only enabled in applications compiled for OS X v10.6 and later.
- (CGColorRef) foregroundColor
The color used to render the receiver’s text. Animatable. Defaults to opaque white.The foregroundColor property is only used when the string property is not an NSAttributedString.Note: Implicit animation of this property is only enabled in applications compiled for OS X v10.6 and later.
- (Object) string
The text to be rendered by the receiver. The text must be an instance of NSString or NSAttributedString. Defaults to nil.
- (String) truncationMode
Determines how the text is truncated to fit within the receiver’s bounds. The possible values are described in “Truncation modes”. Defaults to kCATruncationNone.
- (Boolean) wrapped
Determines whether the text is wrapped to fit within the receiver’s bounds. Defaults to NO.