【问题标题】:How to change font family on TextInput in React Native如何在 React Native 中更改 TextInput 上的字体系列
【发布时间】:2019-11-26 02:58:23
【问题描述】:

全部,

我们正在构建一个 react native 的聊天应用程序,在文本输入中,我们希望像 WhatsApp 一样实现文本更改。我们如何使用 react native 来实现

【问题讨论】:

    标签: reactjs react-native text


    【解决方案1】:

    看看这个包是否能帮到你

    https://github.com/Astrocoders/react-native-selectable-text

    <SelectableText
      menuItems={["Bold", "Copy", "Italic"]}
      /* 
        Called when the user taps in a item of the selection menu:
        - eventType: (string) is the label
        - content: (string) the selected text portion
        - selectionStart: (int) is the start position of the selected text
        - selectionEnd: (int) is the end position of the selected text
       */
      onSelection={({ eventType, content, selectionStart, selectionEnd }) => {}}
      value="I crave star damage"
    />
    

    【讨论】:

      猜你喜欢
      • 2016-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-27
      • 2016-11-08
      • 2016-06-05
      • 1970-01-01
      相关资源
      最近更新 更多