如何创建如下所示的表

Cyr*_*ril 3 iphone xcode cocoa-touch uitableview uikit

我创建了一个TableView(分组表视图).我可以在表格视图中列出项目.但我想知道下表是如何显示的在此输入图像描述

像Calender在左侧,而Gregorian在右侧?Gregorian如何在右侧显示?它是自定义TableView,任何人都可以帮助我如何实现这一目标吗?

yuj*_*uji 10

这些都只是普通的细胞style = UITableViewCellStyleValue1accessoryType = UITableViewCellAccessoryDisclosureIndicator.

以编程方式制作一个:

UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"YourIdentifier"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
Run Code Online (Sandbox Code Playgroud)

(请注意,在现实生活中,您可能会尝试dequeueReusableCellWithIdentifier:,并且只有在返回nil时才创建新单元格.)

或者,如果您正在使用IB,请将"Style"设置为"Right Detail",将"Accessory"设置为"Disclosure Indicator".

  • `cell.detailTextLabel.text = @"喜欢,无论什么"` (3认同)