Implementation method of adding multiple buttons to the sideslip deletion of uitableview in IOS

1、 Requirements:

Cell sideslip deletion has only one delete button by default. Add multiple buttons to sideslip, 'Delete', 'top', 'more'

2、 Implementation description:

1) When we use some applications and slide a line of some contacts, buttons such as delete, top, more, etc. will appear. Before ios8, we need to implement them ourselves. But by ios8, the system has been written, and only one proxy method and one class are needed

2) Ios8 protocol has an additional method. The return value is the tableview: editactionsforrowatindexpath: method of the array. We can write several buttons inside the method, and then put them into the array to return. The class of those buttons is uitableviewrowaction

3) In the uitableviewrowaction class, we can set the button style, displayed text, background color, and button event (the event is implemented in block)

4) In the proxy method, we can create multiple buttons and put them into the array to return. The buttons first put into the array are displayed on the right and the last ones are displayed on the left

5) Note: if we set one or more buttons, the delete button will disappear

3、 Code implementation:

Related reading:

Explain in detail various setting methods for the top blank of uitableview cell in IOS development

The uitableview in IOS scrolls to the specified position

The above is the implementation method of adding multiple buttons to the sideslip deletion of uitableview in Android introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>