iPhone uitablecellview溢出 [英] iphone uitablecellview overflow

查看:41
本文介绍了iPhone uitablecellview溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将溢出隐藏在 UITableViewCell 中?我有一个自定义单元格视图,我将其加载到表中,该表中的某些信息应该在加载时隐藏,然后单击时每一行都会展开.

Is there a way to hide the overflow in a UITableViewCell? I have a custom cell view, that I load into the table, where some of the information is supposed to be hidden on load, and then each row will expand when clicked.

现在,我要为行返回高度 30 ,它是单元格标题的高度,但是应该隐藏的按钮和文本却溢出了,并置于顶部下面的标题.

Right now, I'm returning height 30 for my row, which is the height of the cell header, but the buttons and text that are supposed to be hidden just overflows and is placed on top of the headers below.

推荐答案

虽然可以使用剪辑子视图( cell.contentView.clipsToBounds = YES ),但最好是在添加子视图时使用需要展开和删除折叠的子视图.它应该可以提高性能.

While you can use clip subviews(cell.contentView.clipsToBounds = YES), it's probably best if you add the subviews when you need to expand and remove the subviews the cell collapses. It should increase performance.

这篇关于iPhone uitablecellview溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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