2011-08-08 43 views

回答

0

只是把我的頭頂部可能不是你做這樣的事情:

CFRange visibleRange = CTFrameGetVisibleStringRange(frame); 
int index = (visibleRange.loc + visibleRange.length) - 3; // -3 to make sure the three dots are visible 

NSMutableString *newString = [text mutableCopy]; 
[newString insertString:@"..." atIndex:index] 

// Re-create framesetter and frame with new string. Redraw frame. 
0

文本創建CTParagraphStyle並設置kCTLineBreakByTruncatingTail爲換行符模式。