feat: 点击发送关闭键盘

This commit is contained in:
jinyaqiu 2025-07-29 15:08:06 +08:00
parent 067ed73664
commit 7b725c3fcd
2 changed files with 4 additions and 3 deletions

View File

@ -251,7 +251,6 @@ const styles = StyleSheet.create({
justifyContent: 'space-between', justifyContent: 'space-between',
paddingVertical: 16, paddingVertical: 16,
paddingHorizontal: 16, paddingHorizontal: 16,
backgroundColor: 'white',
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: 'rgba(0,0,0,0.1)', borderBottomColor: 'rgba(0,0,0,0.1)',
elevation: 1, // Android elevation: 1, // Android
@ -279,7 +278,7 @@ const styles = StyleSheet.create({
}, },
contentContainer: { contentContainer: {
flex: 1, flex: 1,
position: 'relative', position: 'relative'
}, },
absoluteView: { absoluteView: {
position: 'absolute', position: 'absolute',

View File

@ -85,6 +85,8 @@ export default function SendMessage(props: Props) {
} }
// 将输入框清空 // 将输入框清空
setInputValue(''); setInputValue('');
// 关闭键盘
Keyboard.dismiss();
} }
} }
useEffect(() => { useEffect(() => {
@ -102,7 +104,7 @@ export default function SendMessage(props: Props) {
timestamp: new Date().toISOString() timestamp: new Date().toISOString()
}]) }])
} else { } else {
console.log('Keyboard will show1213');
} }
} }
); );