我怎样才能使这个弯曲的 svg 可按下?
How can I make this curved svg pressable?
我想要一个弯曲的 svg,想问你如何让这个红色圆圈可以按下?
Curved Bar
使用 Pressable
代替 View
组件。
<View
style={{
position: 'absolute',
width: middleIconSize,
height: middleIconSize,
borderRadius: midRadius,
backgroundColor: 'red',
left: width / 2 - midRadius,
bottom: tabBarHeight - midRadius,
}}
/>
到
<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!')}}
/>
我想要一个弯曲的 svg,想问你如何让这个红色圆圈可以按下?
Curved Bar
使用 Pressable
代替 View
组件。
<View
style={{
position: 'absolute',
width: middleIconSize,
height: middleIconSize,
borderRadius: midRadius,
backgroundColor: 'red',
left: width / 2 - midRadius,
bottom: tabBarHeight - midRadius,
}}
/>
到
<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!')}}
/>