【问题标题】:How do you move React Native Gifted Chat up the screen?你如何将 React Native Gifted Chat 移到屏幕上?
【发布时间】:2021-07-30 10:28:42
【问题描述】:

我有一个带有底部标签导航器的应用程序,还有 React-Native-Gifted-Chat。聊天从屏幕底部开始,因此底部选项卡导航器会阻止它。 Bottom nav bar blocking chat on Webpack Bottom nav bar blocking chat on iOS

我试过了

<GiftedChat
      messages={messages}
      onSend={messages => onSend(messages)}
      user={{
        _id: 1,
      }}
style={{bottom: 20, position: absolute}}
    />

它没有工作。无论如何我可以向上移动聊天,这样我就可以同时拥有底部导航栏和聊天节目并完美地工作?谢谢。

【问题讨论】:

    标签: css react-native


    【解决方案1】:

    将其包裹在 View 中并为该视图设置样式

    <View style={{flex: 1, marginBottom: 20}}>
      <GiftedChat
          messages={messages}
          onSend={messages => onSend(messages)}
          user={{
            _id: 1,
          }}
        />
    </View>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-22
      • 1970-01-01
      • 1970-01-01
      • 2021-10-03
      • 2021-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多