if I understand it, you want a completely clear tableview and tableview cell so you can see the background of your view controller.
You can achieve this by setting the tableview as having no background
tableview.backgroundColor = [UIColor clearColor];
tableView.opaque = NO;
tableView.backgroundView = nil;
and also the cell
cell.backgroundColor = [UIColor clearColor]
if you also want the section to be transparent, you can use this method:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
to make a custom view (for example create an image view with a transparent .png for the background)
I hope I understand your question correctly.
edit after clarification
to give the appearance that the cells stop before going underneath the section header:
make a class that is a subclass of uitableview with this ivar:
@interface CustomTableView : UITableView
{
CAGradientLayer* maskLayer;
}
obviously this will create a gradient but if you wanted you could either tweak it or use CALayer and instead of programmatically creating the mask, create a .png with the correct width/height of your section header.
ANYWAY: if you use the CAGradientLayer:
- (id)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self)
{
[self setupGradients]; //call your method
}
return self;
}
- (void)setupGradients
{
[self addObserver:self forKeyPath:@"contentOffset" options:0 context:nil];
*/ ***** if you choose to use CALayer instead of CAGradient ****** */
//maskLayer = [[CALayer layer] retain];
//maskLayer.contents = (id) [UIImage imageNamed:@"maskLayer.png"].CGImage;
//maskLayer.backgroundColor = [UIColor clearColor].CGColor;
*/ ***
answered 2012-10-05T18:01:16.887