Install UILabel on TableViewCell and
Line is fixed in 3 lines and
Configure LineBreakMode in TranslateTail and
JSON is trying to display variable length characters.
However, if there are more than four lines, the abbreviated three-point reader (…) will not be displayed.
I have the intention of specifying the space between the lines as follows, but
I can't do anything about it.
I also considered adding only the 3-point reader on the label myself.
I don't think I can get the coordinates of the last character before the 3rd line is cut off beautifully...
Could you lend me your wisdom?
Thank you for your cooperation.
// Specify custom LineHeight
CGFloat customLineHeight=19.0f;
// Set lineHeight in paragraph style
NSMutableParagrafStyle*paragrahStyle= [NSMutableParagrafStyle new];
paragrahStyle.minimumLineHeight=customLineHeight;
paragrahStyle.maximumLineHeight=customLineHeight;
// Generate NSAtributedString and set paragraph style
NSMutableAttributedString*attributedText=[NSMutableAttributedString alloc] initWithString:printLabel];
attributeText addAttribute: NSParographStyleAttributeName
value —ParagrahStyle
range —NSMakeRange(0, attributeText.length);
self.printLabel.attributedText=attributedText;
I don't think so, but don't you specify a new line mode in style and label it?
NSMutableParagrafStyle*paragrahStyle=[NSMutableParagrafStyle new];
paragrahStyle.minimumLineHeight=customLineHeight;
paragrahStyle.maximumLineHeight=customLineHeight;
paragrahStyle.lineBreakMode=NSLineBreakByTruncatingTail; // Added
© 2024 OneMinuteCode. All rights reserved.