ios - Why does reloadRowsAtIndexPaths doesn't reload a cell's UILabel alpha value, but reloadData does? -
when select row, method gets called:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [_historyentrytableview reloadrowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; }
and cellforrowatindexpath, i'm dynamically setting alpha value uilabel.
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cell = @"standardcell"; twhistoryviewstandardcell *cell = (twhistoryviewstandardcell *)[tableview dequeuereusablecellwithidentifier:cell]; if (cell == nil) { cell = (twhistoryviewstandardcell *)[[[nsbundle mainbundle] loadnibnamed:@"historyviewstandardcell" owner:self options:nil] objectatindex:0]; } //... if (currentpick == pickdatefrom) { cell.hourslabel.alpha = 1.0; } else { cell.hourslabel.alpha = 0.7; } //... }
if didselectrowatindexpath method call reloaddata on table view, table shows updated cells, expected alpha value. reloadrowsatindexpath no effect whatsoever.
any reason why might happening?
edit:
"hammer fixed" calling reloaddata after reloadrowsatindexpath:
[_historyentrytableview reloadrowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; [_historyentrytableview reloaddata];
it's not realy answer question, now.
does know if there's in cell must called re-render alpha value? it's alpha value of uilabel, because text change correctly.
thank you!
Comments
Post a Comment