Re: UIButton events on a CALayer
Re: UIButton events on a CALayer
- Subject: Re: UIButton events on a CALayer
- From: Kyle Sluder <email@hidden>
- Date: Mon, 29 Jul 2013 18:24:49 -0700
On Mon, Jul 29, 2013, at 05:52 PM, Ian was here wrote:
> I've added a UIButton to a CALayer.
Huh? Views and layers are separate concepts. Views own layers; you can't
add a button to a layer.
> CALayer *prefsLayer = [prefsButton layer];
>
> [prefsLayer setFrame:CGRectMake( x, y, 50.0, 40.0 )];
> [controlBarLayer addSublayer:prefsLayer];
Do not do this. UIView manages its layer.
Please review the View Programming Guide for iOS:
http://developer.apple.com/library/ios/#documentation/windowsviews/conceptual/viewpg_iphoneos/WindowsandViews/WindowsandViews.html
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden