Add Set Rounded Corners Radius Border on Image in React Native

How to show Rounded Corners Radius edges border on Image in React Native android iOS  tutorial using borderRadius attribute used in custom style sheet.

Contents in this project Set Rounded Corners Radius Border :-

  1. Start a fresh React Native project. If you don’t know how then read my this tutorial.
  2. Add Image, StyleSheet and View component in import block.
  3. Create folder for image inside your project’s folder and put your image in it.
  4. Add View tag in render’s return block.
  5. Add Image tag in render’s return block inside View tag.
  6. Add Source attribute in Image tag and Assign image path using require.
  7. Create StyleSheet just above the AppRegistry.registerComponent line.
  8. Inside StyleSheet create two styles Container for complete View and BorderClass for Image.
  9. Call css class into both View and Image tag.
  10. Complete Source Code.

1. Start a fresh React Native project. If you don’t know how then read my this tutorial.

2. Add Image, StyleSheet and View component in import block.

3. Create folder for image inside your project’s folder and put your image in it.

  1. Open your project folder for example my project name is Myproject -> Create a folder inside your project folder like i did in below screenshot name as images.
  2. Place your image inside images folder.

4. Add View tag in render’s return block.

5. Add Image tag in render’s return block inside View tag.

6. Add Source attribute in Image tag and Assign image path using require.

7. Create StyleSheet just above the AppRegistry.registerComponent line.

8. Inside StyleSheet create two styles Container for complete View and BorderClass for Image. Inside the BorderClass, borderRadius attribute is used to set the border corners and make them curved.

9. Call css class into both View and Image tag.

 10. Complete Source Code for index.android.js file :

Screenshot :

Rounded Corners Radius

Leave a Reply

Your email address will not be published. Required fields are marked *