gpt4 book ai didi

iOS UITableViewCell 溢出 contentView

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:04:09 25 4
gpt4 key购买 nike

我正在向 UITableViewCellcontentView 添加 View ,其中一些 View 高于单元格的高度。目前,它只是溢出到它下面的单元格之上,但理想情况下我希望它被裁剪,这样任何不适合单元格的内容都不会显示。有可能吗?

最佳答案

[cell clipsToBounds:YES] 防止任何东西溢出单元格

[cell.contentView clipsToBounds:YES] 防止任何内容溢出 contentView 本身

来自docs

Setting this value to YES causes subviews to be clipped to the bounds of the receiver. If set to NO, subviews whose frames extend beyond the visible bounds of the receiver are not clipped. The default value is NO.

关于iOS UITableViewCell 溢出 contentView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17109847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com