我试图在UITextView中禁用任何类型的角化
不知怎么的,在阿拉伯字母中,文本会看到克恩的字母以符合这一行,但它只会毁掉整个单词,下面是一个例子:

textview有白色背景,代码是:
NSString *aya =[mainArray objectAtIndex:indexPath.row];
cell.tx.text = aya;
[cell.tx sizeToFit];
cell.tx.frame = CGRectMake(5, 5, 265, cell.tx.frame.size.height);
cell.tx.backgroundColor = [UIColor whiteColor];还试图设置NSMutableAttributedString NSKernAttributeName值,但没有工作,
编辑:
这是Kern属性的代码:
NSMutableAttributedString *attributedString;
attributedString = [[NSMutableAttributedString alloc] initWithString:aya];
[attributedString addAttribute:NSKernAttributeName
value:@0.0
range:NSMakeRange(0,[aya length])];
[attributedString addAttribute:NSFontAttributeName
value:font
range:NSMakeRange(0,[aya length])];
NSMutableParagraphStyle *paragrapStyle = [NSMutableParagraphStyle new];
paragrapStyle.alignment = NSTextAlignmentRight;
[attributedString addAttribute:NSParagraphStyleAttributeName
value:paragrapStyle
range:NSMakeRange(0,[aya length])];
[cell.tx setAttributedText:attributedString];发布于 2014-06-12 17:03:09
这是个黑客,我不在电脑附近试一试,但试试看:
tx的text属性
tx setText:aya;attrStr设置为tx
tx setAttributedText:attrStr;这将(希望)保留UITextView从您的NSString推断的属性。
https://stackoverflow.com/questions/23919342
复制相似问题