Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

React Native Rendering Image borderRadius in iOS

$
0
0

Images are rendered in different aspects in ios and android using image component from react-native. I’m trying to display image with 45 degree angle cutoff every corner.

I have tried to use cover, contain and center of the resizeMode prop cover fills the image inside the view giving the 45 degree cut but crops either width or height.

Center does not crop the image but if the image isn’t similar ratio as the view the 45 degree angles aren’t cut of the image, Android does this well though.

<View style={(this.state.controlsDisplayed) ? styles.flexLR : styles.flexLRBlack}>

  <View style={{flex: (Platform.OS === ‘ios’) ? 0.85 : 0.5}} />

  <View style={styles.imageWrapView}>

    <Image source={{uri: ‘file://’ + item.photoLeft}} key={“TDVIEW”} resizeMode={(Platform.OS == ‘ios’) ? ‘cover’ : ‘center’} style={styles.floatingImagePartView} />

  </View>

  <View style={{flex: (Platform.OS === ‘ios’) ? 0.85 : 0.5}} />

</View>

Want to get uncropped images on ios that have corners cut of by 45 degrees. Same as is in the android images. Here are images from android device that are rendered correctly.

android1 cutoff

android1 image

Here are the images rendered on ios using center and cover

android1 cutoff

This is rendered using contain on ios

android1 cutoff

android1 image

How can I get the images rendered with 45 degree cutoff on ios device as it is on an android device?


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>