UITableView line seperator visible for alternative cells in iOS 9

自作多情 提交于 2019-12-20 03:14:05

问题


I am facing issue for UITableView line separator. Line is visible 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:


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



来源:https://stackoverflow.com/questions/34176568/uitableview-line-seperator-visible-for-alternative-cells-in-ios-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!