ios - 为什么cell的分割线自己消失?
本文介绍了ios - 为什么cell的分割线自己消失?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
今天进行很简单的代码测试,代码如下
extension ViewController:UITableViewDataSource,UITableViewDelegate
{
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return restaurant.restaurant.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cellIdentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath)
cell.textLabel?.text = restaurant.restaurant[indexPath.row] as? String
return cell
}
}
运行结果如下
我想知道为什么cell的分割线自救就消失了呢?实在搞不懂了。
已进行的操作:
重置过模拟器,检查过配置,等都没有问题
解决方案
这个问题我也碰到过,模拟器的 Scale 如果不是100%的话有时候就会出现这问题,估计是个 Bug 吧,在真机上是没问题的,把模拟器的 Scale 设为100%应该也能解决问题。
这篇关于ios - 为什么cell的分割线自己消失?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文