简体   繁体   English

当(以编程方式)放置在UINavigationControl中时,围绕UITableView出现不必要的(透明)“边界”

[英]unwanted (transparent) “border” around UITableView when (programmatically) placed in UINavigationControl

On selecting a cell in a UITableView (which itself is placed on the rootView of a UINavigationController) I push a new SubviewController (which has another TableView as its view) onto the NavigationController. 在UITableView(其自身放置在UINavigationController的rootView上)中选择一个单元格时,我将一个新的SubviewController(具有另一个TableView作为其视图)推到NavigationController上。 It all works fine, but when it gets displayed it has a transparent Border around it (the same width on all the sides). 一切正常,但是在显示时,它周围有一个透明的边框(所有边上的宽度相同)。

I have no Idea what the problem could be. 我不知道可能是什么问题。 I'm using the same CustomTableCells as in said rootView and if I look at the Properties of the TableView in IB, the Settings are the same as the ones of the UITableView that sits in the rootView of my UINavigationController... 我正在使用与上述rootView中相同的CustomTableCells,如果我查看IB中TableView的属性,则设置与位于UINavigationController的rootView中的UITableView的设置相同...

您可能要使用initWithStyle:UITableViewStylePlain,以便仍然调用任何特定于tableViewController的东西。

Just solved my own problem... was instantiating said subViewController with a style instead of just calling init... 刚刚解决了我自己的问题...正在用一种样式实例化subViewController,而不仅仅是调用init ...

StationProgramsController *progViewController = [[StationProgramsController alloc] initWithStyle:UITableViewStyleGrouped];

^^left a blank border around my UTTableView^^ ^^在UTTableView周围留有空白边框^^

StationProgramsController *progViewController = [[StationProgramsController alloc] init];

^^no border anymore with the above code^^ ^^以上代码已无边界^^

sorry 抱歉

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

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