【发布时间】:2017-10-30 12:59:21
【问题描述】:
我有一个自定义视图:
它被放置在一个视图控制器中,该控制器嵌入在 UINavigationController 和 UITabViewController 中。
我的自定义视图正在触及我的UINavigationController 和UITabViewController。但我想在顶部和底部之间留出一些空间。 (蓝色添加到集合视图的显示区域)
我已经移动并移除了约束。确保他们在安全区域。
我已经调整了edgesForExtendedLayout
这是我的代码:
photosOverview = [[PhotosOverview alloc] initWithFrame:self.view.frame];
[photosOverview.btnAddPhotos addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
self.edgesForExtendedLayout = UIRectEdgeNone;
[self.view addSubview:photosOverview];
如何调整我的自定义视图,使其容器视图的顶部和底部之间有空间?
【问题讨论】:
-
向安全区域添加垂直约束以留出边距。
标签: ios objective-c uinavigationcontroller uitabbarcontroller