我使用Expo XDE(xde-2.19.3)TextInputs在屏幕上创建了一个本机项目.我KeyboardAwareScrollView用来将键盘下方的输入滚动到视图中并在iOS上正常工作但在Android上不起作用.希望有道理.
看了一下这些KeyboardAwareScrollView文档并发现我需要进行配置,AndroidManifest.xml但看来Expo已经对此进行了整理:https://github.com/expo/expo/blob/master/template-files/android/AndroidManifest.xml
但是我仍然无法在Android上运行...
我能错过什么?
render() {
    return (
      <KeyboardAwareScrollView
        enableOnAndroid='true'
        enableAutoAutomaticScrol='true'
        keyboardOpeningTime={0}
      >
      <ScrollView style={styles.container}>
        <View style={styles.subcontainer}>
          <View style={styles.form}>
              <TextInput
                ref='NoduleCountInput'
                onFocus={() => this.onFocus()}
                onBlur={() => this.onBlur()}
                keyboardType='phone-pad'
                returnKeyType='done'
                placeholder='Test'
                style={styles.field}
              />
              <TextInput
                ref='NoduleCountInput'
                onFocus={() => this.onFocus()}
                onBlur={() => this.onBlur()}
                keyboardType='phone-pad'
                returnKeyType='done'
                placeholder='Test'
                style={styles.field}
              />
              <TextInput
                ref='NoduleCountInput'
                onFocus={() => this.onFocus()}
                onBlur={() => this.onBlur()}
                keyboardType='phone-pad'
                returnKeyType='done'
                placeholder='Test'
                style={styles.field}
              />
              <TextInput
                ref='NoduleCountInput'
                onFocus={() => this.onFocus()}
                onBlur={() => this.onBlur()}
                keyboardType='phone-pad'
                returnKeyType='done' …我正在 React Native 中创建聊天 UI,其中我希望第一部分(显示消息的地方)应该是可滚动的。
应TextInput位于屏幕底部,键盘应位于其后面。
用户界面类似于 WhatsApp 聊天屏幕。但我无法重新创建该用户界面。
我也尝试KeyboardAvoidingView过react-native,但它对我来说不起作用。
import React, { useEffect, useState } from "react";
import {
  ScrollView,
  View,
  Text,
  Alert,
  Dimensions,
  Platform,
  KeyboardAvoidingView,
  TextInput,
  TouchableOpacity,
} from "react-native";
import { Ionicons } from "@expo/vector-icons";
const App = () => {
  const [message, setMessage] = useState([]);
  
  return (
    <View
      style={{
        display: "flex",
        flex: 1,
        justifyContent: "space-evenly",
        alignItems: "center",
        height: Dimensions.get("window").height,
        width: Dimensions.get("window").width,
      }}
    >
      <View
        style={{
          height: Dimensions.get("window").height * 0.8, …