I want to achieve a screen like below image.
I have this transition:
const MyTransition = {
transitionSpec: {
open: {
animation: 'timing',
config: {
duration: 750,
},
},
close: {
animation: 'timing',
config: {
duration: 750,
},
},
},
cardStyleInterpolator: ({ current, next, layouts }) => {
return {
cardStyle: {
transform: [
{
perspective: 750
},
{
translateY: current.progress.interpolate({
inputRange: [0, 1],
outputRange: [height -54, 54],
}),
},
{
scale: current.progress.interpolate({
inputRange: [0, 1, 2],
outputRange: [1.2, 1, .9],
}),
},
],
},
overlayStyle: {
opacity: current.progress.interpolate({
inputRange: [0, 1],
outputRange: [0, 1],
}),
},
}
},
}
Navigator:
<Stack.Navigator
screenOptions={{
headerShown: false,
cardOverlayEnabled: true,
gestureEnabled: true,
...MyTransition,
}}
>
<Stack.Screen name="ScreenA" component={ScreenA} />
<Stack.Screen name="ScreenB" component={ScreenB} mode='modal'/>
</Stack.Navigator>
Please see the transition animation here with Loom video
(BTW, can I embed gif/Loom video into question?)
As you can see from the video,
-Screen A
has unnessessray top empty space.
-Screen A
and Screen B
doesn't have top border radius
.
(If I use borderRadius
, I got this error: Property 'borderRadius' is not supported by native animated module
)
-After Screen B
opened, cannot see the Screen A
under the Screen B
.
How can I solve the above issues?
Edit: In case Loom video doesn't open, I am adding images.