UITableview cell subview larger height then cell -


@all hello

its quite interesting problem have. have subviews can larger in height cell height (its required design). example cell "a" height 40 while subview height= 70.

i can show larger subview when cell goes off screen (i scroll top) subview disappear (obvious) result. gives undesired effect larger subview before extends cell "b" beneath container cell disappear.

i have tried set cell background transparent in willdisplaycell delegate method no luck.

below related method if wants 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 not clear best can explain situation.

i want show views http://postimg.org/image/e5ok5hybl/ image.

if must this, can use simple trick:

  1. move y-origin of table negative value equal amount view extends below cell, e.g. origin -30px.
  2. make table height taller same amount, i.e. make 30px taller.
  3. increase top content inset of table same amount, i.e. increase 30px.

what you've done extend table view off-screen while maintaining original position of cells. since table view extends off-screen, cell not dequeued until part extends below cell has scrolled off screen.

here sample project demonstrating trick.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -