2011-05-18 88 views
0

我得到了一個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; 
} 

回答

4

我沒有完全理解你的問題。如果要停止跳動表視圖可以爲UR努力增加

yourTableView.bounces = NO; 

ViewDidLoad()

+0

它像dis。 .im能夠在我的表格視圖默認情況下查看5項..如果我滾動表來查看剩餘items..im能夠查看剩餘項目..但一旦如果我要擡起我的手指..它帶我到我的表格視圖中的前5個項目... – kingston 2011-05-18 07:57:15

+0

thnaks爲你的努力其工作良好..我給了乾淨的建立和運行... – kingston 2011-05-18 08:17:29

1

如果您需要修復您的tableView,可以禁用滾動功能。

tableView.scrollEnabled = NO; 
+0

花花公子感謝。問題是我想查看錶格視圖中的其餘項目..如果我滾動表格視圖表格視圖rebounces..wait我想要的是查看錶格視圖中的其餘項目沒有滾動 – kingston 2011-05-18 07:50:12