![](/img/trans.png)
[英]Lose focus and dismiss keyboard on clicking outside of the TextInput field in react native?
[英]Keyboard dismiss immediately when focusing textInput for first time react native
當我為cardStyleInterpolator
將 cardStyleInterpolator 設置為forFadeFromBottomAndroid
或forVerticalIOS
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>
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.