简体   繁体   English

iOS TableView和prototypecell约束无法正常工作

[英]iOS TableView and prototypecell constraints not working properly

I have a tableView with a prototypeCell. 我有一个带有prototypeCell的tableView。

I have added constraints to make the tableView take up the whole view: 我添加了一些约束以使tableView占据整个视图:

在此处输入图片说明

I've added a "grey area" to the bottom of my prototypecell that take up 100% of the width. 我在原型单元的底部添加了一个“灰色区域”,该区域占据了宽度的100%。

However when i run the app there is a large area above the first tableCell, and the grey-area doesnt have 100% width: 但是,当我运行该应用程序时,第一个tableCell上方有一个较大的区域,而灰色区域没有100%的宽度:

在此处输入图片说明

What have I done wrong? 我做错了什么? Constraint issue? 约束问题?

You should uncheck Constrain to margins and may be adjust your constraint's values to make your grey view full width. 您应该取消选中“ Constrain to margins并且可能要调整约束的值以使灰色视图变为全角。

Regarding white space on top - looks like it's something wrong with your tableView settings, not cells 关于顶部的空白-您的tableView设置似乎有问题,而不是单元格

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

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