• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UIButton events on a CALayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >UIButton events on a CALayer (From: Ian was here <email@hidden>)

  • Prev by Date: Re: UITableView Cell reordering when cell size is larger than screen size
  • Next by Date: Re: Trying to understand/prevent crash using restorableStateKeyPaths in NSPersistentUI Work
  • Previous by thread: UIButton events on a CALayer
  • Next by thread: Re: UIButton events on a CALayer
  • Index(es):
    • Date
    • Thread