tags:

views:

331

answers:

1

The following code:

http://pastie.org/pastes/835022

in a custom UIView rotates the entire view including the gradient background.

What is the proper way to rotate the polygon without rotating the background?

+1  A: 

I'd separate your gradient from your polygon. Create a gradient layer for the gradient. Put your polygon drawing into the content layer. That should let your polygon be rotated without affecting the background.

Giao
Got the Gradient layer working, but now sure how to draw in the content layer
noel_g
http://developer.apple.com/mac/library/documentation/cocoa/conceptual/CoreAnimation_guide/Articles/ProvidingCALayerContent.html That should provide some guidance on drawing into the content layer of a view.
Giao
Took out all the gradient stuff to try to get content layer to draw and implemented method per docs. http://pastie.org/836160 The view draws completely black. (sorry, n00b on Board)
noel_g
Got drawing in the content layer working, turned gradient layer back on, but content not above gradient. Gradient layer set to 0.
noel_g