【问题标题】:Text selection react-native文本选择反应原生
【发布时间】:2016-07-15 07:26:31
【问题描述】:

我在 react-native 中的文本选择有一些问题:

  1. 如何跨多个文本组件选择文本
  2. 如何检测文本选择
  3. 如何更改文本选择范围

例子:

<View>
  <Text>test1</Text>
  <Text>test2</Text>
</View>

用户应该有可能选择“test1 tes”,应用程序应该检测到它并将选择更改为“test1 test2”?

如果能在安卓上运行就太好了。

我只找到了https://github.com/facebook/react-native/commit/6cd712713b1673f13510bc127ac970648f9b5eb3,但它只在一个文本块内。

【问题讨论】:

    标签: javascript reactjs react-native react-native-android


    【解决方案1】:

    目前我看不到在 React Native 中实现这一点的方法。

    但是,如果你可以使用富文本编辑器,试试这个:https://github.com/HoneyBook/react-native-richtext-editor

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-19
      • 2019-06-14
      • 1970-01-01
      相关资源
      最近更新 更多