簡體   English   中英

react-native-keyboard-aware-scroll-view中平台之間的不同行為

[英]Different behaviours between platforms in react-native-keyboard-aware-scroll-view

我的庫react-native-keyboard-aware-scroll-view有問題。

我已經在 Android windowSoftInputMode="adjustPan"中進行了配置,並且我正在使用enableOnAndroid並且使用相同的代碼,當我在KeyboardAwareScrollView之外的底部使用固定元素時,我有不同的行為。

問題在於,在 iOS 中,我有一個與外部組件高度相同的額外填充。

這是我的測試代碼:

import React from 'react';
import {
  View,
  Text,
  TextInput,
} from 'react-native';
import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'

const App = () => {
  return (
    <>
    <KeyboardAwareScrollView enableOnAndroid extraHeight={0}>
        <View style={{height: 600}}/>
        <TextInput 
        placeholder='hey' 
        style={{
          width: '100%',
          borderWidth: 1,
          height: 60
        }} />
    </KeyboardAwareScrollView>
    <View style={{backgroundColor: '#f0f', paddingVertical: 20, width: '100%'}}>
      <Text>Hello, I'm bottom View</Text>
    </View>
    </>
  );
};

export default App;

這是行為:

iOS

如您所見,TextInput 和 Keyboard 之間的高度填充比 Android 中的要大,並且正好等於底部視圖高度。

iOS

Android

安卓

我該怎么做才能解決這個問題? 提前致謝:)

測試:

iOS:12.2

Android:API 28

注冊護士:0.59.10 和 0.60.5

RNKASV:0.9.1

在否定中使用extraScrollHeight解決了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM