Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在UITableViewCell的侧面制作自定义按钮?_Ios_Swift_Uitableview - Fatal编程技术网

Ios 如何在UITableViewCell的侧面制作自定义按钮?

Ios 如何在UITableViewCell的侧面制作自定义按钮?,ios,swift,uitableview,Ios,Swift,Uitableview,我的代码允许将UITableViewCell向左滑动,它显示一个删除按钮。如何在右侧制作类似的东西,以便进行自定义?试试开源库。它允许您在不同的滑动方向上添加自定义实用程序按钮 在UITableView的tableView:cellForRowAtIndexPath:method中设置所需按钮: cell.leftUtilityButtons = [self leftButtons]; cell.rightUtilityButtons = [self rightButtons]; cell.de

我的代码允许将UITableViewCell向左滑动,它显示一个删除按钮。如何在右侧制作类似的东西,以便进行自定义?

试试开源库。它允许您在不同的滑动方向上添加自定义实用程序按钮

在UITableView的tableView:cellForRowAtIndexPath:method中设置所需按钮:

cell.leftUtilityButtons = [self leftButtons];
cell.rightUtilityButtons = [self rightButtons];
cell.delegate = self;

请注意,如果您将使用代码生成UITableViewCell或Storyboard.UITableViewCell,目前我只使用多点触控,并且可以启用编辑,如果在故事板上有一种更简单的方法,我愿意听到,我的意思是,在Storyboard的情况下,您可以为该自定义UITableViewCell创建自定义类。在该类和故事板上,您可以添加按钮。在您的情况下,您可以从代码中添加按钮。有很多这样的例子——只需谷歌在自定义UITableView单元格中添加按钮。你的问题太笼统了。我也有像你一样的问题-我自己做研究和管理来建造那个按钮。当你有代码,但有些东西不起作用时,你可以在这里询问。参见自定义单元格教程。阅读大约需要30-45分钟。还有一个代码。