CocoaTouch (iPhone) 中的双倍行距文本视图

发布于 2024-08-30 11:41:59 字数 99 浏览 3 评论 0原文

我可以有一个双倍行距的 UITextView 吗?我的意思是,这样当我编辑它时它会保留其格式吗?

我需要在文本行之间显示图形元素。有什么想法吗?

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红焚 2024-09-06 11:42:00

抱歉回复了错误的问题。

问题的答案在这里:
iPhone:禁用“双击空格键。”快捷方式?

将其放入您的委托类中:

- (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;
}

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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文