I currently have a subclass of UIView that "labels" one 2px by 2px CGLayerRef all over the screen, up to 160 x 240 times.
I am currently animating this by moving the UIView “up” to a 2 pixel screen (actually a UIImageView), and then draw the next “row”.
Will using multiple layers of CALayer speed up the rendering of this animation?
Are there any tutorials, sample applications, or code snippets for using CALayer with the iPhone SDK?
I ask that most of the code snippets I find show simple examples of using CALayer calls that do not work with the iPhone SDK. I appreciate any advice or pointers.
Ok, ok, if you want something that has good CA examples that draw such things and work on the phone, I recommend GeekGameBoard , which Jens Aflke published (this is an improved version of some Apple demo code).
, , , , . , , , , , , . - drawRect, , , CGFillRect() . - UIView . , drawRect: UIColor, .
CALayer , iPhone? , CoreImage, , . , , , , , ( - , UIView ), .
, , , . , , , , - UIView/CALayer/UIColor, , , , , .
, , , , , , , , .
- [UIColor initWithPatternImage:] , . , UIColor, .
CALayer , iPhone?
grid . , CAConstraintLayoutManager CAConstraint QuartzCore.h.
CAConstraintLayoutManager
CAConstraint
QuartzCore.h
, 20x20 CALayer UIView, .
CALayer
UIView
UIView, drawRect. drawRect CGLayerRef s:
drawRect
CGLayerRef
"off" 320x480.
"on" CGLayerRef 320x480 (), 320x2 ().
UIImageView 320x478 . "" .
UIImageView
, , CALayer :
Unfortunately, I cannot get the base CALayer to work at the moment and have not found a good piece of code to view and play.