相关疑难解决方法(0)

键盘识别滚动视图Android问题

我使用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' …
Run Code Online (Sandbox Code Playgroud)

android react-native expo

4
推荐指数
3
解决办法
5283
查看次数

TextInput 在反应本机中隐藏在键盘后面

我正在 React Native 中创建聊天 UI,其中我希望第一部分(显示消息的地方)应该是可滚动的。

TextInput位于屏幕底部,键盘应位于其后面。

用户界面类似于 WhatsApp 聊天屏幕。但我无法重新创建该用户界面。

我也尝试KeyboardAvoidingViewreact-native,但它对我来说不起作用。

应用程序.js

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, …
Run Code Online (Sandbox Code Playgroud)

user-interface textinput react-native expo

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

expo ×2

react-native ×2

android ×1

textinput ×1

user-interface ×1