如何呈现方形 ListItem 头像而不是圆形?
How do I render square ListItem avatar instead of round?
我需要渲染方形头像。我该怎么做?
我已经实现了 react native element 文档提供的 listItem 代码:https://react-native-training.github.io/react-native-elements/docs/listitem.html
效果很好,但是在这个版本的react native element 1.1.0中,我不知道如何渲染方形头像而不是圆形。
<ListItem
title={item.name}
subtitle={item.subtitle}
leftAvatar={{ source: { uri: item.icon } }}
/>
我需要左方头像填充列表视图高度。
您可以将 rounded
属性指定为 false
配道具:
<ListItem
title={item.name}
subtitle={item.subtitle}
leftAvatar={{ source: { uri: item.icon }, rounded: false}}
/>
或组件:
<ListItem
title={item.name}
subtitle={item.subtitle}
leftAvatar={<Avatar source={{uri: item.icon}} rounded={false} /> }
/>
https://react-native-training.github.io/react-native-elements/docs/avatar.html#avatar-props
我需要渲染方形头像。我该怎么做?
我已经实现了 react native element 文档提供的 listItem 代码:https://react-native-training.github.io/react-native-elements/docs/listitem.html
效果很好,但是在这个版本的react native element 1.1.0中,我不知道如何渲染方形头像而不是圆形。
<ListItem
title={item.name}
subtitle={item.subtitle}
leftAvatar={{ source: { uri: item.icon } }}
/>
我需要左方头像填充列表视图高度。
您可以将 rounded
属性指定为 false
配道具:
<ListItem
title={item.name}
subtitle={item.subtitle}
leftAvatar={{ source: { uri: item.icon }, rounded: false}}
/>
或组件:
<ListItem
title={item.name}
subtitle={item.subtitle}
leftAvatar={<Avatar source={{uri: item.icon}} rounded={false} /> }
/>
https://react-native-training.github.io/react-native-elements/docs/avatar.html#avatar-props