如何设置borderColor来反应原生元素阿凡达?

时间:2018-04-24 22:01:27

标签: javascript css reactjs react-native avatar

开始变得疯狂,无法找到一种方法来制作边框和borderColor在我的头像上反应原生元素。 我做错了什么?这必须有一个简单的解决方案?

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

1 个答案:

答案 0 :(得分:3)

您需要添加borderWidth。 E.g。

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