gpt4 book ai didi

ios - 需要在不可选择的 UITextView 中调用 shouldInteractWithURL 委托(delegate)

转载 作者:行者123 更新时间:2023-11-30 10:55:23 25 4
gpt4 key购买 nike

我正在使用UITextView显示一些文本,包括一些可点击的名称。

UITextViews位于聊天气泡中,所以我不希望它们可供选择,但我发现委托(delegate)方法 shouldInteractWithURL如果只有 UITextView 则被调用是可以选择的。

有没有什么方法可以让我的文本的某些部分可以点击后面的 URL,而我的 UITextView无法选择?

最佳答案

Apple 文档 isSelectable说:

This property controls the ability of the user to select content and interact with URLs and text attachments. The default value is true.

所以看起来要处理 URL,您必须启用 Selectable

如果您决定这样做,您可以通过无需代码的方式来完成 enter image description here

关于ios - 需要在不可选择的 UITextView 中调用 shouldInteractWithURL 委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54020236/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com