UITableView行分隔符对于iOS 9中的替代单元可见 [英] UITableView line seperator visible for alternative cells in iOS 9

查看:96
本文介绍了UITableView行分隔符对于iOS 9中的替代单元可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临UITableView行分隔符的问题.该行对于其他行可见.

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

将高度为1的UIView添加到单元格将提供解决方案,但这不是正确的方法.下面的代码非常适合iOS 8,但在9中却表现出不同的本质.

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;
}

提前谢谢.

推荐答案

模拟器的常见问题,该模拟器无法始终显示1个像素的视图.在窗口"->比例"中将比例设置为100%.

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

这篇关于UITableView行分隔符对于iOS 9中的替代单元可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆