简体   繁体   English

iOS项目未在我的视图中显示从Interface Builder构建的Interface元素

[英]iOS project not showing Interface elements built from Interface Builder in my view

I am working on a project which includes many UI components on one view(being built in Interface Builder). 我正在一个项目中,该项目在一个视图上包含许多UI组件(已在Interface Builder中构建)。 I have found that after saving and moving my project directory, the interface which should include all of these elements, is empty(there are no visible UI components in the view). 我发现保存并移动了项目目录后,应该包含所有这些元素的界面为空(视图中没有可见的UI组件)。

There are actually 2 projects. 实际上有2个项目。 1 is a framework project, the other is the iphone project which i build & run on the device - everything is contained within a folder which i may move frequently as other members in my team work on it. 1是一个框架项目,另一个是我在设备上构建和运行的iphone项目-一切都包含在一个文件夹中,随着团队中其他成员的努力我可能会经常移动它。

the view which is not properly showing elements, is an XIB file which can be modified through either the iphone project or framework project. 未正确显示元素的视图是XIB文件,可以通过iphone项目或框架项目进行修改。

Why is this happening and how can i troubleshoot this problem further? 为什么会发生这种情况,我该如何进一步解决此问题? I am not sure how to fix it. 我不确定该如何解决。

Many components will not show if they're not been connected to a property, and some will not show if their datasource or delegate is not connected. 如果未连接到属性,许多组件将不会显示,如果数据源或委托未连接,则许多组件将不会显示。

Have you wired everything up, making all of your connections? 您是否已进行所有连线,建立了所有连接?

Could you check the view hierarchy in the -(void)viewDidLoad ? 您可以在-(void)viewDidLoad中检查视图层次结构吗? As Matthew said, if those components are not connected to properties, they won't be shown. 正如Matthew所说,如果这些组件未连接到属性,则不会显示它们。 And, if they are not add onto proper view, then they won't be shown too. 而且,如果未将它们添加到正确的视图中,则也不会显示它们。

You can check the view hierarchy of viewController by browsing the property subViews of self.view . 您可以通过浏览self.view的财产子视图的viewController检查的视图层次。

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

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