tableview的显示的样式主要是在于这几种:
我要重点介绍的是第四种---在一个cell里面分行显示数据(相当于主标题和副标题)
typedef enum {
UITableViewCellStyleDefault, // Simple cell with text label and optional image view (behavior of UITableViewCell in iPhoneOS 2.x 显示标签和图片的简单表单元
UITableViewCellStyleValue1, // Left aligned label on left and right aligned label on right with blue text (Used in Settings)
UITableViewCellStyleValue2, // Right aligned label on left with blue text and left aligned label on right (Used in Phone/Contacts)
UITableViewCellStyleSubtitle // Left aligned label on top and left aligned label on bottom with gray text (Used in iPod).
} UITableViewCellStyle; // available in iPhone OS 3.0
主要是在于这两段代码:
- (UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {