Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image is not rendered when using borderRadius & resizeMode [Android][RN 0.46.2] #15053

Closed
Mindaugas-Jacionis opened this issue Jul 17, 2017 · 15 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Mindaugas-Jacionis
Copy link

Environment

  • react-native: 0.46.2
  • node: 6.9.1
  • npm: 3.10.8
  • yarn: 0.17.9
  • Target Platform: Android
  • Development Operating System: macOS Sierra v10.12.13

Steps to Reproduce

  1. Create Image
  2. Use resizeMode and borderRadius for styling of the image.

Expected Behavior

Image should be rounded and follow resize prop instructions('cover', 'contain', 'stretch', 'repeat', 'center').

Actual Behavior

Instead image simply isn't rendered. If you remove borderRadius or resizeMode. All works as intended.

Reproducible Demo

  1. In terminal run react-native init testImg
  2. open project in text editor and change index.android.js to the one below:
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, View, Image } from 'react-native';

export default class testImg extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Image
          style={styles.avatar}
          source={{uri: 'https://pbs.twimg.com/profile_images/831993825635745796/HnVmB0-k.jpg'}}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },

  avatar: {
    width: 70,
    height: 70,
    borderRadius: 35,
    // resizeMode: Image.resizeMode.contain // uncomment to see the issue
  }
});

AppRegistry.registerComponent('testImg', () => testImg);
  1. In project folder run react-native run-android, you will see working image, but if you uncomment resizeMode in the code - image won't render.
@ItsNoHax
Copy link

ItsNoHax commented Jul 17, 2017

React-Native: 0.46.1 also has this issue

@nehvaleem
Copy link

also having exact same issue

@ismjt
Copy link

ismjt commented Jul 29, 2017

thanks god, you save my time! Is there any solution?

@datnguyen92
Copy link

I have the same issue on RN 0.46.4 as well, do we have plan to fix this?

@ekkucukarpaci
Copy link

I'm also having this issue, tested only on Android. borderRadius only seems to work when resizeMode is 'cover'. Maybe e0bdb7c could be related?

@wielrls
Copy link

wielrls commented Aug 10, 2017

Ditto. My workaround in the short term is to use borderRadius with resizeMode={'cover'}.

@rdixonbhw
Copy link

rdixonbhw commented Aug 14, 2017

It appears to have been caused by this commit e0bdb7c

EDIT: Which has already been reverted in 0.47.

@rendomnet
Copy link

If you will use resizeMode: stretch then border radius will be deformed

@stale
Copy link

stale bot commented Nov 23, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Nov 23, 2017
@shoppy999
Copy link

You don't reply to the issues, but wait them out and close due to inactivity. Brilliant strategy.

@rdixonbhw
Copy link

@shoppy999 This was fixed months ago in 0.47

@raynor85
Copy link

It seems like Images don't work well with the new border properties at all. borderTopWidth, borderTopColor and all the variants don't work at all.

@hramos hramos added the Android label Mar 8, 2018
@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@aligfl
Copy link

aligfl commented Apr 19, 2018

so was this fixed in RN >= 0.47?

@stale
Copy link

stale bot commented Jul 18, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 18, 2018
@stale
Copy link

stale bot commented Aug 17, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 17, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Aug 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests