I realized I was trying to position the start and end point using the layer coordinate system, instead I should use relative values between 0.0 and 1.0.
gradient.startPoint = CGPointMake(0, 0.5); gradient.endPoint = CGPointMake(1.0, 0.5); Like this it works. Thanks for the response. On 1 jul 2010, at 16:41, Kyle Sluder wrote: > On Jul 1, 2010, at 1:09 AM, MB <mar...@mass-it.nl> wrote: > >> When you create a CAGradientLayer, the gradient is vertical. How can you get >> the gradient to go horizontal? I've tried using startPoint and endPoint, but >> that doesn't seem to do the trick. > > But that's indeed how you do it. Care to post your code? > > --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com