使用react-native-elements库ListItem时未显示左头像

时间:2020-08-05 15:23:38

标签: react-native react-native-elements

我正在使用react-native-elements来显示数据列表

import {ListItem} from 'react-native-elements';

const ResultList = ({items}) => {
  const keyExtractor = (item, index) => index.toString();

  return (
    <FlatList
      keyExtractor={keyExtractor}
      data={items}
      renderItem={renderItem}
    />
  );
};

const renderItem = ({item}) => (
  <ListItem
    title="This is my title"
    subtitle="this is my subtitle"
    bottomDivider
    leftAvatar={{
      size: 48,
      activeOpacity: 0.7,
      rounded: false,
      title: 'User',
    }}
  />
);
...

运行我的应用程序时,未显示leftAvatar

enter image description here

为什么没有显示左头像?我希望会显示带有“用户”文字的头像。

0 个答案:

没有答案