๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • What would life be If we had no courage to attemp anything?
Development/React-native

[React-Native] KeyboardAwareScrollView

by DevIseo 2022. 11. 4.

KeyboardAwareScrollView

ํ‚ค๋ณด๋“œ๋ฅผ ์“ฐ๋‹ค ๋ณด๋‹ˆ ์‹ค์ œ ๋ชจ๋ฐ”์ผ ๊ธฐ๊ธฐ์—์„œ ํ‚ค๋ณด๋“œ๊ฐ€ ์˜ฌ๋ผ์™”์„ ๋•Œ์˜ ์ƒํ™ฉ์„ ์ธ์ง€ํ•˜์ง€ ๋ชปํ•จ.

ํ•ด๊ฒฐ๋ฐฉ๋ฒ•1

๋ฆฌ์•กํŠธ ๋„ค์ดํ‹ฐ๋ธŒ์—์„œ ์ œ๊ณตํ•˜๋Š” [KeyboardAvoidingView](https://facebook.github.io/react-native/docs/keyboardavoidingview#docsNav) API๋ฅผ ์ ์šฉ

-> ํ•˜์ง€๋งŒ `ScrollView` ๋‚ด์—์„  ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ๋‹จ์ 

ํ•ด๊ฒฐ๋ฐฉ๋ฒ• 2

[react native keyboard aware scroll view](https://github.com/APSL/react-native-keyboard-aware-scroll-view)

Focus๋œ InputForm์„ ํ‚ค๋ณด๋“œ๊ฐ€ ๊ฐ€๋ฆฌ์ง€ ์•Š๊ฒŒ ํ•จ

์•„๋ž˜์žˆ๋Š” InputForm์„ Focus์‹œ ์ธ์‹ํ•˜์—ฌ ํ‚ค๋ณด๋“œ ์œ„๋กœ ์ด๋™ํ•˜๊ฒŒ ํ•จ!

์„ค์น˜

npm i react-native-keyboard-aware-scroll-view --save

์‚ฌ์šฉ ๋ฒ•

import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
<KeyboardAwareScrollView>
  <View>
    <TextInput />
  </View>
</KeyboardAwareScrollView>

 

 

Reference

https://maruzzing.github.io/study/rnative/KeyboardAvoidingView-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0/

https://coding-hwije.tistory.com/39

'Development > React-native' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[React-Native] Button  (0) 2022.10.30