如上图[日历]app[无事件]的提示,我在我的 app 中设置 label.center = tableview.center 水平是居中了,垂直压着 cell 的线了,不能笨到根据不同分辨率(设备)计算 cell 偏移量然后设置 frame.origin.y 的距离吧?
如下图,因为相对 view 垂直居中不一定不压线
天蓬老师2017-04-17 13:38:44
Specify the proportion for autolayout.
For autoresizingMask, don't fix top and bottom, fix the height, and then change it with the supview ratio.
In fact, you don't need to think about pressing the line, because the tableview is scrolling, and you cannot be sure that the line will not be pressed at any time. You can roughly estimate the height based on the height of the cell, but then you have to set y manually.
ringa_lee2017-04-17 13:38:44
I think the best way is not to display those horizontal lines in rows without data. This way the line won't be pressed.
A simple way is to add:
self.tableView.tableFooterView = [[UIView alloc] init];