ios - How to add image to delete button when we swipe on tableview cell -


i have implemented code delete button when swipe on tableview cell(see first image). want custom means want add image in place of delete button(see second image). googled didn't methods or code. every showing normal delete button. how can add image delete button. ideas!.please me.

enter image description here

enter image description here

probably not idea change button else, users expect behavior remains consistent.however can implement method in custom cell. method called when user performs swipe action :

- (void)willtransitiontostate:(uitableviewcellstatemask)state {      [super willtransitiontostate:state];      if ((state & uitableviewcellstateshowingdeleteconfirmationmask) == uitableviewcellstateshowingdeleteconfirmationmask) {       (uiview *subview in self.subviews)       {           if ([nsstringfromclass([subview class]) isequaltostring:@"uitableviewcelldeleteconfirmationcontrol"]) {                          uiimageview *deletebtn = [[uiimageview alloc]initwithframe:cgrectmake(0, 0, 64, 33)];             [deletebtn setimage:[uiimage imagenamed:@"delete.png"]];             [[subview.subviews objectatindex:0] addsubview:deletebtn];             [deletebtn release];            }        }        }  } 

note : prefer go through apple's hig before implementing customisation.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -