React Native:如何使用按钮内联textInput?

Pra*_*ngh 2 react-native native-base

我在ReactNative中创建chatbot ui如何使用按钮实现嵌入式文本输入?

<View>
 <Textinput />
 <Button>Press</Button>
</View>
Run Code Online (Sandbox Code Playgroud)

Pir*_*hah 5

要水平组织组件,您需要使用flexDirection。默认的flexDirection设置为column

<View style={{ flexDirection:'row' }}>
  <Textinput />
  <Button>Press</Button>
</View>
Run Code Online (Sandbox Code Playgroud)