В моем приложении я использую собственную ячейку с меткой и 4 кнопки в той же последовательности. Теперь, когда в таблице больше данных, и я прокручиваю таблицу, она не позволяет мне правильно прокручивать, и я могу прокручивать только до 7-й строки. и когда я прокручиваю вверх, вся таблица прокручивается вниз. Я установил одну панель навигации вверху. Я пытался изменить размер таблицы до небольшой высоты, но проблема все еще существует. Любое решение для того же?
EDIT
Я публикую исходный код для справки:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(appDelegate.isCompleted ==TRUE)
return [appDelegate.CArray count];
if(appDelegate.isCompleted ==FALSE)
return [appDelegate.PArray count];
else
return 0;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
CellForActivity *cell = (CellForActivity*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[CellForActivity alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.btn1 setTag:indexPath.row];
[cell.btn2 setTag:indexPath.row];
[cell.btn3 setTag:indexPath.row];
[cell.btn4 setTag:indexPath.row];
[cell.btn1 addTarget:self action:@selector(PressC:) forControlEvents:UIControlEventTouchUpInside];
[cell.btn2 addTarget:self action:@selector(PressU:) forControlEvents:UIControlEventTouchUpInside];
[cell.btn3 addTarget:self action:@selector(pressV:) forControlEvents:UIControlEventTouchUpInside];
[cell.btn4 addTarget:self action:@selector(customCellButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
if(appDelegate.isCompleted==TRUE)
{
NSString *strVal = [[appDelegate.CompltedArray valueForKey:@"Subject"]objectAtIndex:indexPath.row];
cell.DescLabel.text = [NSString stringWithFormat:@"%d)%@",indexPath.row+1,strVal];
}
else if(appDelegate.isCompleted==FALSE)
{
NSString *strVal = [[appDelegate.PendingArray valueForKey:@"Subject"]objectAtIndex:indexPath.row];//@"Follow Me";
cell.DescLabel.text = [NSString stringWithFormat:@"%d)%@",indexPath.row+1,strVal];
}
return cell;
return 0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 75;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
У меня есть UINavigation bar в верхней части таблицы.