Border Radius doesn't work on Android
See original GitHub issueHi guys, I’m trying to use the shared element transition and it seems to work correctly apart from the border radius animation on Android. The image itself has border radius, but during the animation it disappears. I tried giving the border radius to the container, and a hidden overflow, but it still doesn’t work. Does anyone know how to fix it? That would be appreciated, thanks in advance
MenuCard:
<SharedElement id={"item.${item.id}.image"}>
<DrinkImage source={{ uri: item.image }} />
</SharedElement>
SingleItemCard:
<SharedElement id={"item.${item.id}.image"} >
<ItemPic source={{uri: item.image}} />
</SharedElement>
MenuNavigator:
const Stack = createSharedElementStackNavigator();
interface MenuNavProps {}
const MenuNav: React.FunctionComponent<MenuNavProps> = () => {
return (
<Stack.Navigator headerMode="none">
<Stack.Screen component={Menu} name="MenuList" />
<Stack.Screen component={SingleItem} name="SingleItem" sharedElementsConfig={(route, otherRoute, showing) => {
const { item } = route.params;
return [{
id: "item.${item.id}.image",
animation: 'move',
resize: 'none',
align: 'auto'
}];
}} />
this is the problem:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
border-radius not working in modern native Android browser
It doesn't show up rounded in the native Android browser; it shows up with square corners. It shows up rounded in desktop Chrome,...
Read more >Border radius doesn't work on Android · Issue #685 - GitHub
Try wrapping the Video element in a container View and setting borderRadius on that View. You will also need to set overflow: hidden...
Read more >Image Border radius doesn't work fully on mobile - Themeco
I've been having trouble with the border radius on mobile, it seems to work fine on desktop, but on mobile it doesn't show...
Read more >CSS Border Radius Not Working in Android WebView or ...
2) Specify top, left right and bottom property separately. some Chrome does understand single value like border-radius : 50px. So here you have ......
Read more >borderRadius doesn't work on Android ScrollView : r/reactnative
A possible work around could be to wrap the ScrollView with a normal View and apply the border radius to that.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+100 for this issue fix! )
To fix this you’ll need to wrap the
<SharedElement>
around the core<Image>
component, like this:Unfortunately, wrapping
<Image>
inside another component work doesn’t correctly on Android. This is because it is not possible to obtain the styles of the image-view natively. Therefore on Android, the styles are obtained in JS and this has its limitations. You can view the code for getting the styles here: https://github.com/IjzerenHein/react-native-shared-element/blob/main/src/SharedElementTransition.tsx#L138-L150As you can see, this only works when the child React node has the
style
prop set. And you therefore have to wrap the component with styles on it directly inside<SharedElement>
.