[英]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.