In my application I am using custom cell with a label and 4 unbuttons in the same sequence. Now when there are more data in the table and i scroll the table,it does not allow me to scroll properly and I am able to scroll only unto 7th row. and when i scroll up,the whole table gets scrolled to down. I have set one navigation bar at the top. I tried to resize the table to small height,but still the problem exists. Any solution for the same?
EDIT
I am posting my source code for reference :
- (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
{
}
I am having a UINavigation bar at the top of the table.
I was having one progress view in my view and after deleting the same my whole problem got solved. And with the same solution,I am closing my question. Thank you.