ios - how to add the UITableView detailDisclosurebutton custom in ipad app -


i have tableview detaildisclosure button works fine want give title detail disclosure button think need add custom uibutton detaildisclosure possible want without using custom cell.

if want give image works fine how may give title button comment.

  cell.accessoryview = [[ uiimageview alloc ]                              initwithimage:[uiimage imagenamed:@"loginn.png" ]]; 

try this..

uibutton *btn = [[[uibutton alloc]init]autoerelease]; btn .frame = cgrectmake(210.0, 0.0, 90, 25); btn = [uibutton buttonwithtype:uibuttontypecustom]; [btn setimage:[uiimage imagenamed:@"loginn.png"] forstate:uicontrolstatenormal]; [btn addtarget:self action:@selector(btnclickhandler:) forcontrolevents:uicontroleventtouchupinside]; [cell.contentview addsubview: btn]; 

and in btnclickhandler indexpath

- (void)btnclickhandler :(uibutton *)button {  uitableviewcell *cell = (uitableviewcell *)button.superview.superview; nsindexpath *indexpath = [tableview indexpathforcell:cell]; //get data source object indexpath.row. } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -