如何在 ios 的编辑模式下对单元格上的文本进行动画处理

发布于 2024-12-14 12:58:43 字数 176 浏览 1 评论 0原文

我有自定义表格单元格,单元格的左右角有两个标签。

现在,当我进入编辑模式时,众所周知,单元格向右移动,因此右侧标签上的文本也向右移动,并且它将变得不可见。

但我想要的是它应该在编辑模式下为自己设置动画,类似于邮件应用程序在编辑模式下的操作,其中文本会移动并且仍然可见。

请帮我解决这个问题。

I have custom table cell with two labels on left and right corner of the cell.

Now when I enter edit mode, as we all know, the cell shifts towards right, so my text on right label also shifts to right and it will become invisible.

But what I want is that it should animate itself in edit mode, similar to what the mail application does in edit mode, where the text shifts and will still be visible.

Please help me out in solving this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖哒 2024-12-21 12:58:43

确保您的标签是这些单元格的 contentView 的子视图。

来自UITableViewCell类参考

contentView 返回单元格对象的内容视图。 (只读)

@property(非原子,只读,保留)UIView *contentView

还要确保整个单元格内容(标签,视图,控件)的autoresizingMask设置正确以适应布局的变化- 例如UIViewAutoresizingFlexibleWidth

Make sure your labels are subviews of the contentView of those cells.

From UITableViewCell Class Reference

contentView Returns the content view of the cell object. (read-only)

@property(nonatomic, readonly, retain) UIView *contentView

Also make sure the autoresizingMask of the entire cell content (labels, views, controls) is setup correctly to adapt to changes in layout - e.g. UIViewAutoresizingFlexibleWidth

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文