简体   繁体   English

具有自动版式的UITableViewCell的最小大小

[英]Minimum size for UITableViewCell with AutoLayout

I was following this tutorial on how to create UITableViewCell with UILabel inside fit the height of it's content and it's working great! 我一直在关注教程, 教程介绍如何使用内部的UILabel创建UITableViewCell使其适合其内容的高度,并且效果很好!

I have just one little problem: I want to make a default minimum size for the UITableViewCell that will not let the Cell to get resized if the content height is smaller than this minimum size. 我只有一个小问题:我想为UITableViewCell设置默认的最小大小,如果内容高度小于此最小大小,则该大小将不允许Cell调整大小。

How could I do that? 我该怎么办?

Thanks in advance. 提前致谢。

You can set a minimum size by setting the constraint's relation to be Greater Than or Equal . 您可以通过将约束的relation设置为Greater Than or Equal来设置最小大小。

Chances are your height constraint is just Equal . 您的身高限制可能就是Equal

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

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