当方向发生变化时,使用 UITableView 调整 UILabel 的大小
我在自定义 UITableViewCell 中有 3 个 UILabel。当设备改变其方向时,这些 UIlabel 的宽度必须改变,因为 tableView 的宽度发生了变化。我的问题是当设备旋转发生时如何调整标签大小。
I've 3 UILabel's inside a custom UITableViewCell. The width of these UIlabels must change when the device changes it's orietation because the tableView's width changes. My problem was how could I resize the label when the device rotation happens.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是将标签的
autoresizingMask
设置为适当的值。你可能会想要这样的东西:The easiest way is to set the labels'
autoresizingMask
to appropriate values. You'll probably want something like this: