[OC]UILabel 文字长的截断方式
Tip: 参考文档:http://blog.csdn.net/reylen/article/details/21012859
@property(nonatomic) NSLineBreakMode lineBreakMode; // default is NSLineBreakByTruncatingTail. used for single and multiple lines of text
lineBreakMode:设置标签文字过长时的显示方式。
// NSParagraphStyle typedef NS_ENUM(NSInteger, NSLineBreakMode) { NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default NSLineBreakByCharWrapping, // Wrap at character boundaries NSLineBreakByClipping, // Simply clip NSLineBreakByTruncatingHead, // Truncate at head of line: "...wxyz" NSLineBreakByTruncatingTail, // Truncate at tail of line: "abcd..." NSLineBreakByTruncatingMiddle // Truncate middle of line: "ab...yz" } NS_ENUM_AVAILABLE(10_0, 6_0);
// NSParagraphStyle typedef NS_ENUM(NSInteger, NSLineBreakMode) { NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default 以单词为显示单位显示,后面部分省略不显示。 NSLineBreakByCharWrapping, // Wrap at character boundaries 以字符为显示单位显示,后面部分省略不显示 NSLineBreakByClipping, // Simply clip 剪切与文本宽度相同的内容长度,后半部分被删除。 NSLineBreakByTruncatingHead, // Truncate at head of line: "...wxyz" 前面部分文字以……方式省略,显示尾部文字内容。 NSLineBreakByTruncatingTail, // Truncate at tail of line: "abcd..." 结尾部分的内容以……方式省略,显示头的文字内容。 NSLineBreakByTruncatingMiddle // Truncate middle of line: "ab...yz" 中间的内容以……方式省略,显示头尾的文字内容。 } NS_ENUM_AVAILABLE(10_0, 6_0);