簡體   English   中英

第一次聚焦 textInput 時鍵盤立即關閉

[英]Keyboard dismiss immediately when focusing textInput for first time react native

當我為cardStyleInterpolator將 cardStyleInterpolator 設置為forFadeFromBottomAndroidforVerticalIOS Stack.Screen ,鍵盤在專注於TextInput時會立即關閉。 其他類型不會發生這種情況。

這只發生在首先關注TextInput時。

這是正在發生的事情:

注冊護士

function RootStack() {
return (
  <Stack.Navigator
    screenOptions={{
      cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
    }}
  >
    <Stack.Screen name="GROUPS" component={GroupsScreen} options={{ headerShown: false }} />
    <Stack.Screen name="GROUP" component={GroupScreen} />
    <Stack.Screen
      name="CREATE_POST"
      component={CreatePostScreen}
      options={{
        headerShown: false,
        cardStyleInterpolator: CardStyleInterpolators.forFadeFromBottomAndroid,
      }}
    />
    <Stack.Screen
      name="SELECT_POST_TYPE"
      component={AnonymousTypeScreen}
      options={{
        cardStyle: { backgroundColor: "transparent", opacity: 1 },
        headerShown: false,
        cardStyleInterpolator: CardStyleInterpolators.forVerticalIOS,
      }}
    />
  </Stack.Navigator>
);
}

屏幕組件只是簡單的組件:

return (
  <View>
    <View style={{ flex: 1 }}>
      <TInput />
    </View>
  </View>
);

我已經降級了 react-navigation (本機和堆棧)的依賴項,因為以前我的代碼可以正常工作,所以嘗試了這個並且它有效。

在此處輸入圖像描述

暫無
暫無

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

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