【发布时间】:2010-04-23 09:49:44
【问题描述】:
我可以有一个双倍行距的 UITextView 吗?我的意思是,以便在我编辑它时保留它的格式?
我需要在文本行之间显示图形元素。有什么想法吗?
谢谢!
【问题讨论】:
标签: ios iphone cocoa-touch uitextview
我可以有一个双倍行距的 UITextView 吗?我的意思是,以便在我编辑它时保留它的格式?
我需要在文本行之间显示图形元素。有什么想法吗?
谢谢!
【问题讨论】:
标签: ios iphone cocoa-touch uitextview
抱歉,回答错了问题。
这里有问题的答案: iPhone: Disable the "double-tap spacebar for ." shortcut?
把它放在你的委托类中:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
//Check for double space
if (range.location > 0 && [[NSCharacterSet whitespaceCharacterSet] characterIsMember:[string characterAtIndex:0]] && [[NSCharacterSet whitespaceCharacterSet] characterIsMember:[[textField text] characterAtIndex:range.location - 1]])
return NO;
return YES;
}
【讨论】: