Monday, 19 August 2013

UITableview cell subview larger height then cell

UITableview cell subview larger height then cell

@All Hello
Its quite interesting problem i have. Actually i have subview which has
larger in height then cell height itself (Its required for my design). For
example cell "A" height is 40 while subview height= 70.
I can show larger subview but when the cell A goes off the screen (i
scroll to top) then its subview also disappear (Obvious) result. But that
gives undesired effect as larger subview which before extends to cell say
"B" beneath container cell suddenly disappear.
I have tried to set cell background as transparent in willDisplayCell
delegate method but no luck.
Below is my related method if anyone wants to see
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil];
if (cell == nil)
{
cell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier]
autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
NSArray *newArray = [[dataDictionary allKeys] sortedArrayUsingSelector:
@selector(compare:)];
[cell.contentView addSubview: [[[dataDictionary objectForKey:[newArray
objectAtIndex:indexPath.section]] objectForKey:@"DayView"]
objectAtIndex:indexPath.row]];
return cell;
}
Pardon me if i am not very much clear but this is best i can explain my
situation.

No comments:

Post a Comment