简体   繁体   English

集合视图在iOS的iMessage Extension中的导航栏后面可见

[英]Collection view visible behind navigation bar in iMessage Extension in iOS

I'm developing iMessage Extension app. 我正在开发iMessage Extension应用程序。 My problem is that the collection view is visible behind navigation bar in expand mode. 我的问题是,在展开模式下,集合视图在导航栏后面是可见的。

Is there anybody who has experience in this area? 有没有在这方面有经验的人? Looking for any help. 寻找任何帮助。

Give constraint to your CollectionView like this while Constraint to margins is unselected. 像这样给您的CollectionView Constraint to margins而未选择“ Constraint to margins

在此处输入图片说明

Source code 源代码

您可以尝试将集合视图的内容偏移量更改为,以将其移动到导航栏下方,如下所示:

collectionView.contentOffset = CGPointMake(0, navigationController.navigationBar.frame.size.height)

After give Constraints(Top:0,Left:0,Right:0,Bottom:0),you should give Top Constraints of CollectionView to Top Layout Guide.Bottom ratherthan Superview.Top like this: 给出Constraints(Top:0,Left:0,Right:0,Bottom:0)之后,您应该将CollectionView的Top Constraints交给Top Layout Guide.Bottom而不是Superview.Top像这样:

CollectionView.Top = Top Layout Guide.Bottom is set to 0. CollectionView.Top =顶部布局指南。底部设置为0。

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

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