iphone - Problems Making a TableView Fade -
using uiview animatewithduration
, i'm setting uitableview
alpha 0 fades away in disappearing animation. however, i'm noticing when uitableview
fades, there areas on each cell turn black before fading. if there image, whole area behind turns black while fading, , inset space on both left , right edge turn black. i've tried setting of background colors of uitableviewcell
subviews white , still doesn't work.
this tableview not embedded in uitableviewcontroller. instead, it's separate floating tableview i'm using menu.
here example of happens when it's fading:
here code i'm using well
[uiview animatewithduration:imageviewcontrollerbarsanimationduration delay:0 options: uiviewanimationoptionallowuserinteraction animations:^ { if (self.menu.superview) { self.menu.alpha = 0; } } completion:^(bool finished) { if (self.menu.superview) { [self.menu removefromsuperview]; self.menu.alpha = 1; } }];
+
- (uitableviewcell *) tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *tableviewcell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (tableviewcell == nil) { tableviewcell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier] autorelease]; } [[tableviewcell textlabel] setfont:[uifont fontwithname: @"helvetica-bold" size: 17]]; [[tableviewcell textlabel] settext: [self.menuitems objectatindex:0]]; [[tableviewcell imageview] setimage: [self.menuitems objectatindex:1]]; return tableviewcell; }
dts gave me solution this, have following:
self.mytableview.backgroundview = nil; self.mytableview.backgroundcolor = [uicolor clearcolor];
then inside of cellforrowatindexpath
method have this:
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *konecellid = @"cellid"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:konecellid]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:konecellid] autorelease]; cell.backgroundview = [[uiview alloc] init]; cell.backgroundview.backgroundcolor = [uicolor whitecolor]; } ... }
Comments
Post a Comment