UITableView上的奇怪线条

时间:2014-05-18 20:13:57

标签: ios iphone objective-c uitableview

enter image description here


我不知道为什么会这样。

所以这是我的代码:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [thumbnails count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"SimpleTableCell";

    SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
    if (cell == nil)
    {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }

    cell.thumbnailImageView.image = [UIImage imageNamed:@"CamilleSeaman.jpg"];

    return cell;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 2;
}

删除heightForRowAtIndexPath委托方法

enter image description here

1 个答案:

答案 0 :(得分:2)

尝试删除heightForRowAtIndexPath委托方法。