Iphone uitableview滚动在目标c中滚动整个表
在我的应用程序中,我使用带有标签的自定义单元格,并以相同的顺序解开4个按钮。现在,当表格中有更多数据时,我滚动表格,它不允许我正确滚动,我只能滚动到第7行。当我向上滚动时,整个桌子就会向下滚动。我在顶部设置了一个导航栏。我试图将桌子调整到较小的高度,但问题仍然存在。有相同的解决方案吗 编辑 我将发布我的源代码以供参考:Iphone uitableview滚动在目标c中滚动整个表,iphone,objective-c,uitableview,xcode4,Iphone,Objective C,Uitableview,Xcode4,在我的应用程序中,我使用带有标签的自定义单元格,并以相同的顺序解开4个按钮。现在,当表格中有更多数据时,我滚动表格,它不允许我正确滚动,我只能滚动到第7行。当我向上滚动时,整个桌子就会向下滚动。我在顶部设置了一个导航栏。我试图将桌子调整到较小的高度,但问题仍然存在。有相同的解决方案吗 编辑 我将发布我的源代码以供参考: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (N
- (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
{
}
我在表的顶部有一个导航栏。我的视图中有一个进度视图,删除该视图后,整个问题都解决了。用同样的方法,我结束了我的问题。谢谢。请在tableview数据源和委托中发布方法。请在更新的问题中查找源代码。谢谢您。