如何在iOS上以编程方式截断两行表格单元格中的尾巴 [英] How to truncate tail in a two lines table cell programmatically on iOS

查看:60
本文介绍了如何在iOS上以编程方式截断两行表格单元格中的尾巴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一本书的名称显示在表格视图中。表格视图单元格有2行 cell.textLabel.numberOfLines = 2 现在,我想截断第二行的尾部。

I have a a book names shown in a table view. The table view cells has 2 lines cell.textLabel.numberOfLines = 2 Now I want to truncate the tail of the second line. Is this possible to achieve programmatically?

推荐答案

label.lineBreakMode = UILineBreakModeTailTruncation;

但是,截尾是UILabel对象的默认设置。

However, truncate tail is the default setting for UILabel objects.

为清楚起见,请参阅 UILabel类引用

这篇关于如何在iOS上以编程方式截断两行表格单元格中的尾巴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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