UITableView line seperator visible for alternative

2019-02-25 22:01发布

I am facing issue for UITableView line separator. Line is visible for alternative rows. Missing line for alternative rows

Adding UIView with height 1 to the cell will give the solution but this is not the correct way. And the below code is working perfect for iOS 8 but in 9 it's showing different nature.

- (IBAction)curencySelect:(id)sender {
    currencyTable = [[UITableView alloc]initWithFrame:CGRectMake(29, 257, 265,113) style: UITableViewStylePlain];
}
#pragma mark -
#pragma mark UITableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    return 1;
}

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


    return currencyArray.count;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{


       UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];

       if (cell == nil) {

            cell =[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];
       }



    cell.textLabel.text = [currencyArray objectAtIndex:indexPath.row];

    return cell;
}

Thanks in advance.

1条回答
做自己的国王
2楼-- · 2019-02-25 22:45

Common problems with the simulator, which can't always display 1 pixel views. Set scale to 100% in Window->Scale.

查看更多
登录 后发表回答