简体   繁体   English

情节提要集合视图拒绝进入以编程方式创建的按钮

[英]Storyboard collection view refusing to go in front of programmatically created button

I have a storyboard collection view that I hide until a button is pressed. 我有一个故事板集合视图,我一直隐藏该视图,直到按下按钮为止。 However, there is a programmatically created button that sticks in front of the collection view. 但是,有一个以编程方式创建的按钮,它粘贴在集合视图的前面。 The below isn't working. 以下不起作用。 How do I get that programmatically created button behind that storyboard collection view? 如何在情节提要集合视图后面获取以编程方式创建的按钮?

  [self.view bringSubviewToFront:collectionView];

In Storyboard make sure the CollectionView be below the button in the list on the left. 在情节提要中,确保CollectionView在左侧列表中的按钮下方。

If that doesnt work either. 如果那也不起作用。 Try to insert the view: 尝试插入视图:

[self.view insertView:collectionView atIndex:[[self.view subviews]count]+1];

OR 要么

[self.view insertView:collectionView aboveView:self.button];

暂无
暂无

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

相关问题 添加故事板视图作为以编程方式创建的视图的子视图 - Add a storyboard view as a subview of a programmatically created view 在故事板中的集合视图末尾添加按钮 - Add button at the end of collection view in storyboard 无法在表格视图单元格内滚动集合视图(在情节提要中创建) - Unable to scroll Collection view inside Table view cell (created in Storyboard) 如何在iPhone中以编程方式从一个视图转到故事板 - How to go form one view to storyboard programmatically in iPhone 故事板视图(iphone 4/5/6)布局影响集合单元大小(以编程方式设置) - Storyboard view(iphone 4/5/6) layout effecting collection cell size (programmatically set) 在Storyboard中创建的TabbarController无法以编程方式更改视图 - Created TabbarController in Storyboard can't change view programmatically 如何从不在情节提要中但以编程方式创建的视图控制器呈现位于“主”情节提要中的视图控制器? - How to present a view controller that is in the “main” storyboard from a view controller that isn't in the storyboard but is created programmatically? 后退按钮以编程方式转到上一个视图 - Make back button go to the previous view programmatically 如何以编程方式从一个情节提要中的一个视图控制器转到另一个情节提要中的另一个视图控制器? - How to go from one view controller in One storyboard to another viewcontroller in another storyboard programmatically? 以编程方式将按钮添加到集合视图单元格 - Programmatically Adding Button To Collection View Cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM