Проверьте ссылку, прилагаемую к ссылке. Линия между первыми двумя ячейками имеет отступ, но линия между двумя нижними ячейками проходит полностью. Первые две ячейки - это отдельный раздел, чем нижняя ячейка (так что есть 2 раздела, предыдущий кодер установил его таким образом, и так оно и должно быть ...). Я пытаюсь получить линию между двумя нижними ячейками так же, как линия между двумя первыми (отступом). Какой был бы лучший способ сделать это? Pic прилагаетсяРедактировать строки между ячейками?
здесь метод cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"InAppPurchaseViewCellIdentifer";
// InAppPurchaseViewCell *cell = (InAppPurchaseViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
InAppPurchaseViewCell *cell = (InAppPurchaseViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSArray *currentSectionArray = nil;
switch (indexPath.section) {
case 0:
currentSectionArray = _productGroupZeroArray;
break;
case 1:
currentSectionArray = _productGroupOneArray;
break;
case 2:
currentSectionArray = _productGroupTwoArray;
break;
case 3:
currentSectionArray = _productGroupThreeArray;
break;
default:
break;
}
NSDictionary *currentProductDictionary = [currentSectionArray objectAtIndex:indexPath.row];
NSString *currentProductIdString = [currentProductDictionary objectForKey:kInAppOptionProductID];
__block SKProduct *currentProduct = nil;
[_skProductArray enumerateObjectsUsingBlock:^(SKProduct *product, NSUInteger idx, BOOL *stop) {
if ([product.productIdentifier isEqualToString:currentProductIdString]) {
currentProduct = product;
*stop = YES;
}
}];
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
cell.productNameLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.productNameLabel.textColor = [UIColor darkGrayColor];
cell.priceLabel.backgroundColor = [UIColor colorWithRed:249.0/255.0 green:198.0/255.0 blue:6.0/255.0 alpha:1.0];
cell.priceLabel.textColor = [UIColor whiteColor];
} else {
cell.productNameLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.productNameLabel.textColor = [UIColor darkGrayColor];
cell.priceLabel.backgroundColor = [UIColor colorWithRed:249.0/255.0 green:198.0/255.0 blue:6.0/255.0 alpha:1.0];
cell.priceLabel.textColor = [UIColor whiteColor];
}
cell.userInteractionEnabled = YES;
if ([[InAppPurchaseHelper sharedInstance] productPurchased:currentProduct.productIdentifier]) {
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
cell.priceLabel.textColor = [UIColor colorWithRed:0.0 green:0.576 blue:0.0 alpha:1.0];
} else {
cell.priceLabel.backgroundColor = [UIColor colorWithRed:0.0 green:0.576 blue:0.0 alpha:1.0];
}
cell.priceLabel.text = @"Paid";
cell.userInteractionEnabled = YES;
} else {
[_priceFormatter setLocale:currentProduct.priceLocale];
NSString *priceString = [_priceFormatter stringFromNumber:currentProduct.price];
cell.priceLabel.text = priceString;
}
cell.frame = CGRectOffset(cell.frame, 10, 10);
if (currentSectionArray == _productGroupZeroArray) {
cell.productNameLabel.text = [tableData objectAtIndex:indexPath.row];
}else if (currentSectionArray == _productGroupOneArray) {
cell.productNameLabel.text = @"Annual Subscription:\nTestBank for every exam!";
}
return cell;
}
Добавить код таблицы. –
Лучший способ - сделать свой собственный разделитель с UIView высотой 1 ... полностью настраиваемый ... (так что вы также можете скрыть последний разделитель) – altagir