2

Hi
I have a UITableView in my class and when i tried to load the contents am getting a screen like this

enter image description here

Below the white box am not able to see the horizodal separator line , Please help me.

My code:

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;    //count of section
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [names count];    //count number of row from counting array hear cataGorry is An Array
}


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

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];

    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                       reuseIdentifier:MyIdentifier]
        ;
    }

    // Here we use the provided setImageWithURL: method to load the web image
    // Ensure you use a placeholder image otherwise cells will be initialized with no image
    cell.imageView.frame=CGRectMake(5,10,50,60);
    cell.imageView.image=[imaages objectAtIndex:indexPath.row];
    cell.textLabel.text = [names objectAtIndex:indexPath.row];
    cell.backgroundColor=[UIColor clearColor];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

    return 80;

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
}
Tulon
  • 4,011
  • 6
  • 36
  • 56
Bangalore
  • 1,572
  • 4
  • 20
  • 50

1 Answers1

5

write in your view did load

In iOS 7 and later, cell separators do not extend all the way to the edge of the table view.This property sets the default inset for all cells in the table, much like rowHeight sets the default height for cells. It is also used for managing the “extra” separators drawn at the bottom of plain style tables.

// Do any additional setup after loading the view.
if ([_tableView respondsToSelector:@selector(setSeparatorInset:)]) {
    [_tableView setSeparatorInset:UIEdgeInsetsZero];
}
Pawan Rai
  • 3,434
  • 4
  • 32
  • 42