본문 바로가기
앱개발/React Native

RN - Gesture에 대해서

by pretzel1 2025. 12. 8.

2025/12/28 기록

StickerSmash 예제를 해보다보니 GestureDetector라는게 나왔다.

웹 개발만 하다보니 터치.. 로 무언가를 할 수 있다는게 놀라운데, 사실 생각해보면 마우스가 터치인건데 왜 놀라울까..

 

GestureDetector는 마치 react dnd 사용할 때 그 구간을 정해줬던 그런 컴포넌트의 느낌이다. 

<GestureDetector gesture={drag}>
            <Animated.View style={[containerStyle, { top : -350}]}>
                <GestureDetector gesture={doubleTap}>
                    <Animated.Image
                        source={stickerSource}
                        resizeMode = "contain"
                        style={[imageStyle, {width : imageSize, height : imageSize}]}
                    />
                </GestureDetector>
               
                {/* <Image source={stickerSource} style={{width: imageSize, height :imageSize}} /> */}
            </Animated.View>
        </GestureDetector>

'앱개발 > React Native' 카테고리의 다른 글

RN - 스크린샷 구현하기, collapsable  (0) 2025.12.08
RN - 권한 요청  (0) 2025.12.08
RN - useSharedValue  (0) 2025.12.08
RN - React Native 제스처 핸들러  (0) 2025.12.07
ReactNative와 TypeScript  (0) 2025.12.04

댓글