Border radius for only top left right rounded corners Image View React Native iOS Android Example

The Style has its 2 unique radius property which is used to make only both top sides corners rounded. This type of functionality we have seen in many applications and one of the most popular social chatting platform Hike in India uses this. So in this tutorial we would going to create a react native app and set Border radius for only top left right rounded corners Image View React Native.

Note: Both borderTopLeftRadius and borderTopRightRadius properties is yet not supported(Working) by Image component in iOS devices but by wrapping the Image inside View we can do this easily.

Style property:

borderTopLeftRadius : This is used to make only Top Left Side corners rounded in Image and View or any other component style.

borderTopRightRadius : This is used to make only Top Right Side corners rounded on Image, View and all components.

Contents in this project Border radius for only Top Left Right Rounded Corners Image View in React Native:

1. Import Platform, StyleSheet, View and Image component in your project.

2. Create a Root View in render’s return block. Now we would make another child View inside the main view. Now we would wrap the  Image component inside View, We would calling a sample gradient image created by myself from our server.

3. Create Style for View and Image component. Now we would call the both borderTopLeftRadius, and borderTopRightRadius on child View style.

4. Complete source code for App.js File :

Screenshots in Android device:

Border radius for only top left right rounded corners Image View

Screenshot in iOS device: