- UIView *content([[[UIView alloc] initWithFrame:[_contentView frame]] autorelease]);
- [content setBackgroundColor:[_contentView backgroundColor]];
- [_contentView setBackgroundColor:[UIColor clearColor]];
- [_contentView setFrame:[content bounds]];
+ UIView *layer;
+ if (&_contentLayer != NULL)
+ layer = _contentLayer;
+ else if (&_contentView != NULL)
+ layer = _contentView;
+ else
+ layer = nil;
+
+ UIView *content([[[UIView alloc] initWithFrame:[layer frame]] autorelease]);
+ [content setBackgroundColor:[layer backgroundColor]];
+ [layer setBackgroundColor:[UIColor clearColor]];
+ [layer setFrame:[content bounds]];