模态视图控制器 UITextView 多个文本字段的子视图

发布于 2024-11-02 22:04:44 字数 284 浏览 5 评论 0原文

当用户单击文本字段时,我会推送一个包含单个 UITextView 的模式视图控制器。我希望用户能够在该 UITextView 中输入文本,使用保存按钮关闭模式视图,并使该文本显示在原始文本字段中。如果只有一个文本字段,这并不难。

但是,我想对许多文本字段和只有一个模式 UITextView 视图执行此操作,这可能吗?更具体地说,如果不为每个按下的 TextField 创建子类,这是否可能?如何指示在 UITextView 中输入的文本仅存储在触摸以推送模式 UITextView 的任何文本字段中?

非常感谢。 埃里克

when a user clicks on a textField, I push a modal view controller that contains a single UITextView. I would like the user to be able to enter text in that UITextView, dismiss the modal view with a save button and have that text appear in the original textField. This is not hard if there is only one textField.

However, I would like to do this with many textfields and only one modal UITextView view, is this possible? More specifically, is this possible without creating a subclass for each TextField pressed? How do I inidicate that the text entered in the UITextView is to only be stored in whatever textField was touched to push modal UITextView?

Many thanks.
Eric

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

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

发布评论

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

评论(1

往日情怀 2024-11-09 22:04:44

对于那些想知道的人,您可以为每个文本字段的编辑方法设置标准用户默认值。我花了一段时间才弄清楚这个问题。

For those of you wondering, you set a standard user default to each textField's is editing method. It took me a while to figure this one out.

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