简体   繁体   English

tableview标头中的标签未出现在ipad上,但出现在iphone上

[英]Label in tableview header doesn't appear on ipad but on iphone

in my universal app I have an UITableViewController embedded in a UINavigationController. 在我的通用应用程序中,我在UINavigationController中嵌入了一个UITableViewController。 When I add a UIView to the top of the tableView and insert a UILabel which is centered in the container, the label is only visible on iPhone but not on iPad. 当我将UIView添加到tableView的顶部并插入位于容器中心的UILabel时,标签仅在iPhone上可见,而在iPad上不可见。

I tried creating a new testapp, only consisting of these two controllers, the view and the label. 我尝试创建一个仅由这两个控制器(视图和标签)组成的新testapp。 It works on both, iPhone and iPad. 它可以在iPhone和iPad上使用。 So I added two new controllers to my app in the same way and made the navigation controller the initial view controller. 因此,我以相同的方式向我的应用添加了两个新的控制器,并将导航控制器设为初始视图控制器。 Label is visible on iPhone but not on iPad. 标签在iPhone上可见,但在iPad上不可见。

For me it seems, that I have changed some global settings in the app; 对我来说,我似乎已经更改了应用程序中的某些全局设置。 on another view I have similar problems with stackViews, but I first concentrate on this "simple" problem... 在另一个视图上,stackViews也有类似的问题,但我首先关注这个“简单”的问题...

Any ideas what might be wrong in my app-settings? 有任何想法可能会导致我的应用设置出现问题吗?

tableViewController embedded in navigationController 嵌入在navigationController中的tableViewController

Take a UIViewController embedded in a UINavigationController. 以嵌入在UINavigationController中的UIViewController为例。 Add View, Label, and TableView and check it 添加视图,标签和表格视图并进行检查

Ok. 好。 Now I know what was the problem. 现在我知道出了什么问题。 Never have checked, what's going on with those size classes. 从来没有检查过,这些大小类发生了什么。

During development I changed from any/any to a smaller size, not knowing, that this is not only taking effect on the layout in the storyboard. 在开发过程中,我从任何大小更改为较小的大小,不知道这不仅会影响情节提要中的布局。 Everything I added after changing did'nt show on iPad. 我更改后添加的所有内容均未在iPad上显示。

Solution: Select storyboard, in "File Inspector", uncheck "Use Size Classes" 解决方案:选择情节提要,在“文件检查器”中,取消选中“使用大小类”

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

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