第二个UITableView中的单元格在顶部填充 [英] Cells in 2nd UITableView are been padded at top

查看:130
本文介绍了第二个UITableView中的单元格在顶部填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个视图控制器中并排有两个表视图,它们都在自己的视图中。

I have two table views side by side in the same view controller, they are both within their own view.

右边的第二个是填充的左手一个是正确的。

The second one on the right is been padded where as the left hand one is correct.

我删除了第二个,并复制了第一个以确保每个设置100%相同,但仍然无法删除填充,以便细胞水平排列。

I have deleted the second one and copied the first to ensure every settings is 100% identical but still cannot remove the padding so that the cells line up horizontally.

下面是一个屏幕截图,显示我的故事板,simular和Xcode视图heirarchy,有人可以告诉我这出错的地方。

Below is a screen shot showing my Storyboard, simular and Xcode view heirarchy, could someone please let me know where this is going wrong.

推荐答案

这可能是因为包含UITableView的UIView是最顶层的视图控制器的主视图。 此人解决了一个看似相似的问题通过在表格上方添加垃圾透明视图来防止插图自动按下单元格。

This might be occurring because the UIView containing that UITableView is the topmost view in the controller's main view. This Person solved a seemingly similar issue by adding a garbage transparent view above the table to prevent the insets from automatically pushing the cells down.

如果这对您不起作用,有许多可能的解决方案< a href =https://stackoverflow.com/questions/18880341/why-is-there-extra-padding-at-the-top-of-my-uitableview-with-style-uitableviewst>这里 。

If that doesn't work for you, there are many possible solutions here.

编辑:一个很好的实验是看看将左手表视图放在右手表视图上方是否会导致表格交换填充。

An excellent experiment would be to see if putting that left hand table view above the right hand table view causes the tables to swap the padding.

这篇关于第二个UITableView中的单元格在顶部填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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