Search code examples
javascriptcssreactjsreact-nativeavatar

How to set a borderColor to react native elements Avatar?


Starting to go crazy, can´t find a way of making a border and borderColor on my Avatar from react native elements. What im i doing wrong ? This must have an easy solution ?

enter image description here

<Avatar
      medium
      rounded
      source={{ uri: this.props.profile[0].profile_picture }}
      onPress={this.toggleModal.bind(this)}
      iconStyle={{ borderColor: 'white', borderTopLeftRadius: 1,borderStyle:'solid' }}
      containerStyle={{ borderColor:'white', borderTopLeftRadius: 1, borderStyle:'solid'  }}
      avatarStyle={{borderColor: 'white', borderTopLeftRadius: 1,borderStyle:'solid' }}
/>

Solution

  • You need to add a borderWidth. E.g.

    avatarStyle={{ borderWidth: 2, borderColor: 'white', borderTopLeftRadius: 1, borderStyle:'solid' }}