开发者

How to Show detail view of table cell inside of table view?

开发者 https://www.devze.com 2023-01-20 07:53 出处:网络
I\'ve a problem. I want to create a table view 开发者_运维百科in which each cell is a name of a place and when the user clicks on the cell, the cell next to it should shift down to accomodate a new vi

I've a problem. I want to create a table view 开发者_运维百科in which each cell is a name of a place and when the user clicks on the cell, the cell next to it should shift down to accomodate a new view after the clicked cell. The new view will display the address of the place the clicked cell displayed.

for example: If cell2 contains XYZ Park.The user clicks on cell2. Now a new view will be displayed after the cell2 & in between cell2 & cell3.This new view will display the address of the XYZ Park.

Please help me & tell that is this possible?? :(


Yes, I think that it is possible:

On cell selection, you can add a new cell on the UITableView:

– insertRowsAtIndexPaths:withRowAnimation:

Then, the table view data source will received message:

– tableView:cellForRowAtIndexPath:

You can return a new cell with the detail (for address).

Be carefull: You have to think about the indexPath of all you cells with a new cell inserted.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号