如何将组件添加到卡片标题容器react-native-elements

我在我的React Native项目中使用React-native-elements。我需要使用react-native-vector-icons在卡标题的右侧添加一个“ +”号,如下所示。我浏览了文档,但找不到任何相关内容。

如何将组件添加到卡片标题容器react-native-elements

<Card
   title="Resources"
   titleStyle={{
     textAlign: 'left',}}
>
   <Text style={{textAlign: "center"}}>No resources</Text>
</Card>
zjm550 回答:如何将组件添加到卡片标题容器react-native-elements

如本issue中所述,可以为title提供一个react组件。因此,以下内容可以正常工作。

<Card titleStyle={{textAlign: 'left'}} title={
   <View style={{display: "flex",flexDirection: "row"}}>
     <Text>About me</Text>
     <View style={{flexGrow: 1}} />
     <FIcon name="edit"/> 
   </View>
}>
   <Text style={{marginBottom: 10}}>{userData.bio}</Text>
</Card>
本文链接:https://www.f2er.com/3166639.html

大家都在问