ios - Is there any way to change "DELETE" button from UITableViewCell? -


i want change delete button in uitableviewcell. actually, need :

  1. change position of button
  2. font
  3. text color of button.

here can change button text in following delegate method :

- (nsarray<uitableviewrowaction *> *)tableview:(uitableview *)tableview editactionsforrowatindexpath:(nsindexpath *)indexpath   {       uitableviewrowaction *viewaction = [uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledefault title:@"follow" handler:^(uitableviewrowaction *action, nsindexpath *indexpath) {            nslog(@"view action fired");       }];       viewaction.backgroundcolor = [uicolor clearcolor];        return @[callaction];   }   

but how change other attributes of button. if knows, please let me know.

thanks.

to working, implement following 2 methods on uitableview's delegate desired effect

- (bool)tableview:(uitableview *)tableview caneditrowatindexpath:(nsindexpath *)indexpath {     return yes; }   - (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath { // need implement method esle nothing work:  } 

check method created name of uitableviewrowaction *viewaction returned teh value of callaction modify once , try

- (nsarray<uitableviewrowaction *> *)tableview:(uitableview *)tableview editactionsforrowatindexpath:(nsindexpath *)indexpath   {       uitableviewrowaction *callaction = [uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledefault title:@"follow" handler:^(uitableviewrowaction *action, nsindexpath *indexpath) {            nslog(@"view action fired");       }];       callaction.backgroundcolor = [uicolor clearcolor];        return @[callaction];   }   

in standard uitableviewrowaction can't change , can change

style

title

backgroundcolor

backgroundeffect

for more information see apple documents


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -