У меня есть вид для iPhone, который в основном разделен на два, с информационным дисплеем в верхней половине и UITableView для выбора действий в нижней половине. Проблема в том, что в первой ячейке UITableView нет границы или разделителя над первой ячейкой, поэтому первый элемент в списке выглядит смешно. Как добавить дополнительный разделитель в верхней части таблицы, чтобы отделить его от области отображения над ним?
Вот код для создания ячеек - это довольно просто. Общая компоновка обрабатывается в xib.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
switch(indexPath.row) {
case 0: {
cell.textLabel.text = @"Action 1";
break;
}
case 1: {
cell.textLabel.text = @"Action 2";
break;
}
// etc.......
}
return cell;
}