iphone - CALayer 是否导出其内容?

标签 iphone cocoa-touch core-animation calayer

调查后Custom UITableViewCell backgroundView & selectedBackgroundView ,我注意到每层 backgroundViewselectedBackgroundView (分组 TableView 的每个单元格)都有一个 CGImageRef 作为其内容。

Apple 必须创建每个 CGImageRef 并显式设置每个层的内容吗?

最佳答案

是的,UIGroupTableViewCellBackground 是其图层的委托(delegate),并在 displayLayer: 中设置其图层的内容。我通过使用 setContents: 方法创建 MyLayer : CALayer 来解决这个问题,在该方法中放置一个断点,并实现 +[UIGroupTableViewCellBackground layerClass]返回[MyLayer 类]。然后,我检查了断点被击中时的回溯。

关于iphone - CALayer 是否导出其内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9337901/

相关文章:

iphone - 如何在旋转 90 度后将图像添加到 CALayer 的背面?

iphone - 如何从 UITableViewCell 中删除背景图像?

ios - 如何在水平分页 ScrollView 中添加日期选择器?

ios - 如何在 Settings.bundle 中的 xCode 中添加额外的 plists 以便与 InAppSettingsKit iPhone 库一起使用?

ios - CAGradientLayer 使用 UIScrollView 滚动

iphone - 在 XCODE 4.2 中崩溃时线程不会停在实际的代码行

ios - 动画 AVPlayerLayer 变换属性

iphone - websockets 和 iOS 中的实时更新

iphone - [UIView beginAnimations :context:] and [UIView animateWithDuration:animations:] 之间的区别

iphone - 是否有可能成功地为移动的 UIButton 制作动画?