English 中文(简体)
• 如何设计关于电离层扰动的分辨率 在使用故事片“SOS5”时的看法?
原标题:How to design subviews for UIScrollView when using storyboards for iOS5?

I am using the example from this question: How to combine UIScrollview with UIPagecontrol to show different views? to add a UIScrollView containing multiple subviews to a page in my iPad app.

我在顶部有一大看法,然后在底层有一个小箱子。 底层的盒子是UIScrollView;用户将沉积,有权为这一小节中的各种功能提供箱子。 顶上的大观点从未改变,因此我不认为是适当的。

I have a storyboard with a single View Controller Scene in it. While I can add views to this I can t design off screen views; in other words, there s nowhere I can draw each of my subviews. How can I do this? Do I need to make separate XIBs for each subview? If so, how do I load them in? Or, should I instead make my scrollview (subview width * subview count) wide and draw each view adjacent to the previous one? This is my first iOS app so I may well have some things backwards.

增 编

Tim

问题回答

Currently storyboards are not ideal for doing this however you should not use separate nib files. Instead you should pull on other viewControllers and setup each of their views as required. You must remember to set the identifier of the view controller in interface builder and then you can load the view like so,

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *myViewController = [storyboard instantiateViewControllerWithIdentifier:@"MyViewControllerIdentifierInIB"];

现在,各位持观点的控制者可以接触到,并在你愿意的地方添加。

注:为了改变你的看法,你必须选择意见控制器,改变其在接口建设商的特性检查员的大小,使之实现自由。 然后,你将能够改变观点的规模。

我也发现,但最终你却失去了报道的目的,即向各位介绍你的制图应用。

我确实感到这里缺乏的是一个新的可可物体,即UIPagedScrollController,如果在故事板上添加的话,它就会像UITool Bartroller和UINavigationController那样,自行过渡,而是由UIPageControl和UIScrollView组成的。

最后,我发现,我可以在独立的国家银行中设立分行。 在次调查中,我将档案所有权身份确定在我的主视控制器类别中,并在次调查中向观察控制员添加一个小册。 然后,我把国家银行的分调查与卷宗所有人中的分册联系起来。

Finally in the main view controller s viewDidLoad I call this for each subview NIB:

[[NSBundle mainBundle] loadNibNamed:@"MySubView" owner:self options:nil];




相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签