表视图containg图像视图
问题描述:
我得到了一个imageview ..下面的imageview是一个表视图..它从server.by加载数据默认情况下表视图中的五个字段是可见的..精细..如果我要滚动表视图来查看剩余的字段..滚动器rebounces..wat我想要的是表格视图被修复,而不是在滚动时不会反弹..id是如此的伟大,如果你们家伙帮助我out..below是代码..表视图containg图像视图
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [items count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 28.0;
}
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0,
tableViewteam.bounds.size.width, 28)] autorelease];
headerView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"team"ofType:@"png"]]];
return headerView;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
}
cell.selectionStyle=UITableViewCellSelectionStyleNone;
cell.imageView.backgroundColor=[UIColor clearColor];
cell.textLabel.text=[[items objectAtIndex:indexPath.row]objectForKey:@"title"];
cell.textLabel.textColor=[UIColor whiteColor];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
答
我没有完全理解你的问题。如果要停止跳动表视图可以为UR努力增加
yourTableView.bounces = NO;
在ViewDidLoad()
答
如果您需要修复您的tableView,可以禁用滚动功能。
tableView.scrollEnabled = NO;
+0
花花公子感谢。问题是我想查看表格视图中的其余项目..如果我滚动表格视图表格视图rebounces..wait我想要的是查看表格视图中的其余项目没有滚动 – kingston 2011-05-18 07:50:12
它像dis。 .im能够在我的表格视图默认情况下查看5项..如果我滚动表来查看剩余items..im能够查看剩余项目..但一旦如果我要抬起我的手指..它带我到我的表格视图中的前5个项目... – kingston 2011-05-18 07:57:15
thnaks为你的努力其工作良好..我给了干净的建立和运行... – kingston 2011-05-18 08:17:29