我正在尝试为我的用户个人资料屏幕实现一个圆形头像。但我不知道为什么它没有出现圆形。
我检查了我的样式表,还尝试将头像元素放入另一个视图标签中。但它不起作用。
我的个人资料屏幕:
return(
<View style={styles.container}>
<View style={styles.header}></View>
<Avatar
style={styles.avatarContainer}
size={"large"}
rounded
onPress={this.takePicture}
activeOpacity={0.7}
source={{uri:User.image}}
showEditButton
avatarStyle={{borderRadius:63}}
/>
<View style={styles.body}>
<View style={styles.bodyContent}>
<Text style={styles.name}>{User.name}</Text>
<Text style={styles.info}>{User.phone}</Text>
<TouchableOpacity onPress={this.updateProfile} style={styles.buttonContainer}>
<Text style={{color:'#fff'}}>UPDATE</Text>
</TouchableOpacity>
{/* <TouchableOpacity onPress={this._logOut} style={styles.buttonContainer}>
<Text>LOGOUT</Text>
</TouchableOpacity> */}
</View>
</View>
</View>
)
我的样式表:
avatarContainer: {
borderRadius: 63,
height:130,
width:130,
borderWidth: 4,
borderColor: "white",
marginBottom:10,
alignSelf:'center',
position: 'absolute',
marginTop:130
},
我希望我的头像元素是圆形的,但它是方形的。