Я использую tableview в iOS. Я получаю 10 элементов в массиве, и после того, как я последний элемент на таблице, я получаю более 10 элементов. Его работа прекрасна, но некоторые ячейки перекрываются и черные в цвете. Наложение перекрытий становится нормальным после нескольких секунд, но черный цвет остается постоянным. Я новичок в iOS. Пожалуйста помоги.Ячейка стала черной из TableView в iOS
- (void)getNewMailFromBottom
{
if (!isFinished && !isSideMenu && !searching) {
NSInteger resultsSize = [foldersDataArray count];
NSInteger count=0;
NSMutableArray *tempMailArray = (NSMutableArray *)[NSArray arrayWithArray:(NSArray *)[dataBase getFolderMails:[mailBoxAccountId integerValue]:currentFolderLocalId:[foldersDataArray count]:10]];
if ([tempMailArray count]==0 &&[appDelegate internetConnection] && [Globals getAuthenticationTicket] && ![[Globals getAuthenticationTicket] isEqualToString:@""] && ([[NSUserDefaults standardUserDefaults]boolForKey:@"ALL_MAILS"] || [[NSUserDefaults standardUserDefaults]boolForKey:@"DEFAULT_MAILS"]) && currentFolderLocalId !=appDelegate.draftLocalId && currentFolderLocalId != appDelegate.localOutboxLocalId) {
[self getAllFolderDataDetail :currentFolderId:YES];
} else {
for (NSDictionary *dict in tempMailArray) {
if (![foldersDataArray containsObject:dict]) {
[foldersDataArray addObject:[dict objectForKey:@"mailDetail"]];
count++;
}
}
NSMutableArray *arrayWithIndexPaths = [NSMutableArray array];
for (NSInteger i = resultsSize; i < resultsSize + count; i++)
[arrayWithIndexPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]];
[myTableView insertRowsAtIndexPaths:arrayWithIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[pullToRefreshManager tableViewReloadFinished];
}
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableCell";
SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
cell =[nib objectAtIndex:1];
cell.selectionStyle=UITableViewCellAccessoryNone;
NSInteger sectionsAmount = [tableView numberOfSections];
NSInteger rowsAmount = [tableView numberOfRowsInSection:[indexPath section]];
if ([indexPath section] == sectionsAmount - 1 && [indexPath row] == rowsAmount-1) {
NSLog(@"hello");
[refreshBottomConnection cancel];
[self getNewMailFromBottom];
[pullToRefreshManager setPullToRefreshViewVisible:NO]; }
return cell;
}
разместить свой код. – Rushabh
i m проводка код обязательно проверьте. –
Ваша высота ячейки динамична? –