如何通过情节提要自动布局使表格视图适合导航栏下方的超级视图 [英] How to fit tableview to superview below navigation bar via storyboard autolayout

查看:70
本文介绍了如何通过情节提要自动布局使表格视图适合导航栏下方的超级视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个禁用滚动的tableview,它将填充导航栏下面的视图.最终,我设法做到了,但这不是正确的方法,因为我给tableview提供了负64的边距(状态栏+导航栏).

I want to create a scroll disabled tableview which will fill the view below navigation bar. Finally I've managed to do it but it's not the right way because I'm giving minus 64 margin (status bar + navigation bar) to tableview.

我正在从情节提要中分配约束.我在表格视图中尝试了许多其他约束,例如从4个侧面给出零约束或 相等的宽度+相等的高度+中心水平+中心垂直没有一个有效.

I'm assigning my constraints from storyboard. I've tried lots of other constraints with the table view like giving zero constraints from 4 sides or equal width + equal height + center horizontal + center vertical none of them worked.

解决此问题的正确方法是什么.

What is the right way to solve this problem.

情节提要的屏幕截图如下.

Screenshot from the storyboard are below.

推荐答案

我解决了.

取消选中其中四个,并添加下图所示的约束,按我的意愿进行工作.

unchecking four of them and adding the constraints from image below worked as I wanted.

因此,我想在禁用这四个视图控制器选项的情况下,禁用滚动禁用的表视图无法按预期工作.

So I guess scroll disabled tableviews not working as expected with these four view controller options checked.

这篇关于如何通过情节提要自动布局使表格视图适合导航栏下方的超级视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆