有办法显示我的头像PNG? 因为它不像我的例子那样工作



有没有办法显示我的头像png?因为它不像我的例子那样工作 我尝试显示我的 JPG 图像,但它对我不起作用,我不知道为什么. 它现在向我展示了一个不圆的灰色形状,我想要一个圆形的 JPG。 我的错误是什么?

import React,{ Component } from 'react';
import { View, Text, StyleSheet, Platform ,Image } from 'react-native';
import { HeaderButtons, Item } from "react-navigation-header-buttons";
import HeaderButton from "../components/HeaderButton";
import { Avatar } from 'react-native-elements';

const OrderInformationScreen = props => {
return(
<View
style={{
//   height: 150,
//   backgroundColor: '#00BFFF',
alignItems: 'center',
justifyContent: 'center'
}}
>
<Avatar
size='large'
//    overlayContainerStyle={{ backgroundColor: '#00BFFF' }}
containerStyle={{ marginTop: 30 }}
activeOpacity={0.2}
rounded
ImageSource={require('../assets/up.png')}  style={{height: 120, width: 120, borderRdius: 60 }}
/>
<View>
<Text style={{ fontSize: 30 }}>yes</Text>
</View>
</View>
);
};
export default OrderInformationScreen

你可以使用 React Native 本身的Image

<View style={{ width: 120, height: 120, borderRadius: 60 }} />
<Image source={require('../assets/up.png')} resizeMode={'cover'} style={{ width: 120, height: 120 }}/>
</View>

最新更新