ios - Create custom UITableViewCell with sliding object -
i in need of creating own custom uitableviewcell
. within each cell, want have view switch. switch going have label on , users supposed able swipe right move switch right , swipe left move switch left. have drawn simple prototype picture can see here: pictures (basically blue part supposed moved right , left swipes)
i have managed in simple way. creating view, containing square view, adding gesture view , move using animation.
the problem if try add view custom uitableviewcell
, nothing happens.
any tips or ideas appreciated.
you need add view cell through
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {
within method following:
{ uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"customcell" forindexpath:indexpath]; uiview *customview = (uiview *) [cell viewwithtag:100]; customview.frame = cgrectmake(0, 0, self.tableview.frame.size.width, self.tableview.frame.size.height); //bla bla bla return cell; }
if using storyboard, assuming are, make sure add customidentifier cell well, in case "customcell". clicking on cell , typing in id.
if still not work, ensure have delegates hooked correctly in code , storyboard, ensure tableview linked etc.
hope helps!
Comments
Post a Comment