0

Can I have a double-spaced UITextView? I mean, so that it retains its formatting when I edit it?

I need to display graphical elements in between the lines of text. Any ideas?

Thanks!

Anjali Kevadiya
  • 3,567
  • 4
  • 22
  • 43
Ron
  • 157
  • 1
  • 9

1 Answers1

0

Sorry Replied to wrong question.

Answer is for question here: iPhone: Disable the "double-tap spacebar for ." shortcut?

Put this in your delegate class:

- (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;
}
Community
  • 1
  • 1
Chaise
  • 41
  • 3