最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to set a borderColor to react native elements Avatar? - Stack Overflow

programmeradmin2浏览0评论

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 ?

<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' }}
/>

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 ?

<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' }}
/>
Share Improve this question asked Apr 24, 2018 at 22:01 qwertyballqwertyball 1351 gold badge2 silver badges11 bronze badges 1
  • avatarStyle={{ border: '1px solid #fff', borderTopLeftRadius: 1 }} – Liam Commented Apr 24, 2018 at 22:23
Add a ment  | 

1 Answer 1

Reset to default 14

You need to add a borderWidth. E.g.

avatarStyle={{ borderWidth: 2, borderColor: 'white', borderTopLeftRadius: 1, borderStyle:'solid' }}
发布评论

评论列表(0)

  1. 暂无评论