ios - how to add a custom view in the selected row in UITableView? -


i new @ programming , struggling in this. how add custom view in selected row in uitableview?

all other rows should not affected. new view should appear in place of row clicked. view can have bigger size. thanks.

you can add new view in rowdidselect delegate method,

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {  uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath];  uiview *myview = [[uiview alloc] initwithframe:cgrectmake(10.0f, 10.0f, 100.0f, 30.0f)]; [myview settag:-1];  [cell addsubview:myview];  } 

implement diddeselectrowatindexpath given

- (void)tableview:(uitableview *)tableview diddeselectrowatindexpath:(nsindexpath *)indexpath {  uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath];  uiview *myview = [cell viewwithtag:-1];  [myview removefromsuperview]; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -