带有文本第一个字符的UITableView

时间:2016-07-23 05:27:01

标签: ios objective-c xcode uitableview tableview

我的阵容包括:Barney Eskin,Aaron Hoe,Dale Perella,Earl Bruice,Fabian Oleski,Calvin Zinnes

问题1:如何创建UITableView,其中包含使用不同图像创建的初始圆圈以及其中字符串的第一个字母。 (如下图所示)

enter image description here

问题2:如何添加滑动手势以打开菜单并对其执行操作,如下图所示:

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以将第三方库用于可滑动的单元格。有许多库提供此功能,但这是最好的

1。MGSwipeTableCell

2。SWTableViewCell

对于第一个字符,您可以在其中创建自定义UILabel并使用if ([string hasPrefix:@"0"] && [string length] > 1) { string = [string substringFromIndex:1]; } ,然后您可以从字符串中获取第一个字符,如下所示:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>