ios - AsyncDisplayKit CellNode setting highlighted color -
i'm using async display kit display cell nodes in astableview. how can set custom color cell node's selected state. normal tableview cells override
- (void)sethighlighted:(bool)highlighted animated:(bool)animated
in cell implementation, method doesn't exist on ascellnodes. has else encountered problem , how did solve it?
assuming you've subclassed ascellnode create own cells, add own sethighlighted method.
e.g.
- in ascellnode subclass
- (void)sethighlighted:(bool)highlighted { if (highlighted) { self.backgroundcolor = [uicolor bluecolor]; } else { self.backgroundcolor = [uicolor whitecolor]; } }
- in delegate implementation
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { mynodesubclass * node = (mynodesubclass *)[(astableview *)tableview nodeforrowatindexpath: indexpath]; [node sethighlighted: yes]; }
note: you'll need maintain own state in regards cells selected/deselected
Comments
Post a Comment