@@ -15,7 +15,7 @@ const uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAMAAAC7m5rvA
1515
1616function Demo () {
1717 return (
18- < View style= {{ flexDirection: ' row' }}>
18+ < View style= {{ flexDirection: ' row' ,justifyContent : ' space-around ' }}>
1919 < Avatar src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
2020 < Avatar src= {uri} / >
2121 < / View>
@@ -26,6 +26,72 @@ export default Demo
2626
2727```
2828
29+ ### 头像尺寸
30+
31+ ``` jsx mdx:preview
32+ import React from ' react' ;
33+ import { View } from ' react-native' ;
34+ import { Avatar } from ' @uiw/react-native' ;
35+
36+ function Demo () {
37+ return (
38+ < View style= {{ flexDirection: ' row' ,justifyContent: ' space-around' }}>
39+ < Avatar size= {20 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
40+ < Avatar size= {30 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
41+ < Avatar size= {40 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
42+ < Avatar size= {50 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
43+ < / View>
44+ );
45+ }
46+
47+ export default Demo
48+
49+ ```
50+
51+ ### 设置头像圆角
52+
53+ ``` jsx mdx:preview
54+ import React from ' react' ;
55+ import { View } from ' react-native' ;
56+ import { Avatar } from ' @uiw/react-native' ;
57+
58+ function Demo () {
59+ return (
60+ < View style= {{ flexDirection: ' row' ,justifyContent: ' space-around' }}>
61+ < Avatar rounded= {0 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
62+ < Avatar rounded= {5 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
63+ < Avatar rounded= {10 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
64+ < Avatar rounded= {20 } src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
65+ < / View>
66+ );
67+ }
68+
69+ export default Demo
70+
71+ ```
72+
73+ ### 指定头像的形状
74+
75+ circle 圆头像
76+ square 正方形头像
77+
78+ ``` jsx mdx:preview
79+ import React from ' react' ;
80+ import { View } from ' react-native' ;
81+ import { Avatar } from ' @uiw/react-native' ;
82+
83+ function Demo () {
84+ return (
85+ < View style= {{ flexDirection: ' row' ,justifyContent: ' space-around' }}>
86+ < Avatar shape= ' circle' src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
87+ < Avatar rounded= ' square' src= " https://avatars.githubusercontent.com/u/24369183?v=4" / >
88+ < / View>
89+ );
90+ }
91+
92+ export default Demo
93+
94+ ```
2995### Props
3096
3197继承 [ View] ( https://facebook.github.io/react-native/docs/view#props ) 组件。
0 commit comments