简体   繁体   English

iOS - 细胞分隔符不会出现在UITableView上

[英]iOS - Cell Separators Don't Appear on UITableView

The cell separators on my table view do not appear in the iOS simulator. 我的表视图上的单元格分隔符不会出现在iOS模拟器中。 Here is the ViewController: 这是ViewController:

http://i.imgur.com/qFja6nm.png http://i.imgur.com/qFja6nm.png

Here are the warnings I have: 以下是我的警告:

http://i.imgur.com/iubdGYZ.png http://i.imgur.com/iubdGYZ.png

The custom segue is the one that I have when the user clicks on a cell in the table. 自定义segue是用户单击表格中的单元格时的自定义segue。 I use a search display controller in the code for searching with the search bar, and displaying in the table view. 我在代码中使用搜索显示控制器来搜索搜索栏,并在表格视图中显示。

Here is what the iOS simulator shows: 这是iOS模拟器显示的内容:

http://i.imgur.com/7Oku66X.png http://i.imgur.com/7Oku66X.png

The cell separators do appear when I click and drag the table, but not when it is not being interacted with. 单击并拖动表格时会出现单元格分隔符,但在未与其进行交互时则不会出现。

I also include these lines in the code in an attempt to fix the problem: 我还在代码中包含这些行以尝试解决问题:

tableView.separatorStyle = UITableViewCellSeparatorStyle.SingleLine
self.automaticallyAdjustsScrollViewInsets = false

EDIT: 编辑:

Here are the settings for the tableView: 以下是tableView的设置:

http://i.imgur.com/slt48tU.png http://i.imgur.com/slt48tU.png

http://i.imgur.com/NCIJfS1.png http://i.imgur.com/NCIJfS1.png

http://i.imgur.com/EXyWvTt.png http://i.imgur.com/EXyWvTt.png

iOS 11 simulators: + 2 ( Pixel Accurate option) iOS 11模拟器: + 2Pixel Accurate选项)


iOS 10 and below simulators: + 1 ( 100% scale option) iOS 10及更低版本的模拟器: + 1100% scale选项)


Physical device: always work just fine. 物理设备:总是工作得很好。


Also, you can show the separators by interacting with the UITableView (unless scrolling / bouncing is turned off). 此外,您可以通过与UITableView交互来显示分隔符(除非scrolling / bouncing关闭)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM