# Avatar

用户头像。

# 基本用法

avatar-1

import {Avatar} from 'react-native-maui';

<Avatar
  style={{ width: 60, height: 60, marginHorizontal: 10 }}
  url={'https://avatars.githubusercontent.com/u/16695567?s=400&u=fd8d6249fa408e1e606015a06868a99993171938&v=4'}
/>
<Avatar
  style={{ width: 60, height: 60, borderRadius: 30, marginHorizontal: 10 }}
  url={'https://avatars.githubusercontent.com/u/16695567?s=400&u=fd8d6249fa408e1e606015a06868a99993171938&v=4'}
/>

# 展位图

avatar-2

import {Avatar} from 'react-native-maui';

<Avatar
  style={{ width: 60, height: 60, borderRadius: 30, marginHorizontal: 10 }}
  url={'https://avatars.githubusercontent.com/u/16695567?s=400&u=fd8d6249fa408e1e606015a06868a99993171938&v=4'}
  placeholder={<Text>加载中</Text>}
/>
<Avatar
  style={{ width: 60, height: 60, marginHorizontal: 10 }}
  url={'https://avatars.githubusercontent.com/u/16695567?s=400&u=fd8d6249fa408e1e606015a06868a99993171938&v=4'}
  placeholder={<ActivityIndicator />}
/>

# 属性

名称 描述 类型 默认值
url
Required
图片加载的路径,本地图片或者网络url。 string -
style
Required
图片样式 ImageStyle -
placeholder 在图片未加载出来前,占位图。 React.ReactNode -
delay 在图片加载出来后,到完全显示图片的时间,单位ms。 number 500
resizeMode 图片展示模式。 ImageResizeMode cover
Last Updated: 7/5/2022, 9:18:33 AM