0

I want to have a curved svg and want to ask you how to can I make this red circle pressable ?

Curved Bar

universe11
  • 703
  • 1
  • 11
  • 35

1 Answers1

1

Use Pressable instead of View Component.

<View
  style={{
    position: 'absolute',
    width: middleIconSize,
    height: middleIconSize,
    borderRadius: midRadius,
    backgroundColor: 'red',
    left: width / 2 - midRadius,
    bottom: tabBarHeight - midRadius,
  }}
/>

to

<Pressable
  style={{
    position: 'absolute',
    width: middleIconSize,
    height: middleIconSize,
    borderRadius: midRadius,
    backgroundColor: 'red',
    left: width / 2 - midRadius,
    bottom: tabBarHeight - midRadius,
  }}
  onPress={() => {console.log('Do what you want!')}}
/>
  • its not working I dont get console log statement and when I use touchableOpacity I dont get opacity animation. €: I added zIndex now it works, ty! – universe11 Apr 08 '22 at 16:07