简体   繁体   English

以编程方式将视图添加到情节提要

[英]Add views to a storyboard programatically

I'm going to explain my situation 1st so that the question is clear. 我将首先解释我的情况,以便使问题清楚。 I'm using a scrollview with images in it right now. 我正在使用带有图像的滚动视图。 Those images right now link to different views in a storyboard. 这些图像现在链接到情节提要中的不同视图。 Instead what I'd like to do is have that image open up a new UIScrollview w/ views displayed. 相反,我想做的是让该图像打开一个新的带有视图的UIScrollview。 These views are already in the storyboard of course without nibs. 当然,这些观点已经存在于故事板上。

So I'm essentially trying to display UIViews in a UIScrollView.. except I cant' initialize with nib (at least to my knowledge). 所以我实质上是想在UIScrollView中显示UIViews。除了我不能用笔尖初始化(至少据我所知)。

如果要在Storyboard中寻找一个设置滚动视图的地方,请使用awakeFromNib

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

相关问题 UIStackView在情节提要中添加重叠的视图 - UIStackView add overlapping views in Storyboard 向故事板中的tabbarController添加更多视图 - add more views to tabbarController in storyboard 删除主 Storyboard.Add StoryBoard 以编程方式向后兼容 - After deleting Main Storyboard.Add StoryBoard Programatically with Backward compatibility 如何在所有视图Storyboard iOS上添加视觉效果视图模糊? - How To Add Visual Effect Views Blur On All Views Storyboard iOS? iOS - 以编程方式添加新视图以使用我的storyboard autolayout viewcontroller - iOS - Programatically add a new view to work with my storyboard autolayout viewcontroller 无法以编程方式将视图添加到情节提要中的现有子视图 - Can't add a view to an existing subview in storyboard programatically 如何在 UIScrollview 中添加视图,然后使用故事板 iOS objC 添加约束 - How to add views in UIScrollview and then add constraints using storyboard iOS objC 以编程方式实时定位故事板 - Localize storyboard programatically on the fly 通过xib或storyboard将子视图添加到UICollectionViewCell的contentView中 - add sub views into UICollectionViewCell's contentView via xib or storyboard 以编程方式在垂直堆栈视图内添加多个水平堆栈视图 - Programatically add multiple horizontally stack views inside vertical stack view
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM