首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >图标没有显示

图标没有显示
EN

Stack Overflow用户
提问于 2021-02-08 14:37:28
回答 1查看 29关注 0票数 0

我想使用MaterialCommunityIcons,但图标没有显示我在搜索答案,但我没有找到任何很酷的东西

代码语言:javascript
复制
import ...
import MaterialCommunityIcons from 'react-native-vector-

icons/MaterialCommunityIcons'
    
const Tab = createMaterialBottomTabNavigator();

export class main extends Component {
    componentDidMount(){
        this.props.fethchUser();
        this.props.fethchUserPosts();
    }
    render() {
        const {currentUser} =  this.props;
        console.log(currentUser)
        return (
            
            <Tab.Navigator tabBarOptions={{showIcon:true}} initialRouteName="خانه" barStyle={{ backgroundColor: '#0059b3' }}>
                <Tab.Screen name="خانه" component={HomeScreen} options={{tabBarIcon:({color,size})=>{
                    <MaterialCommunityIcons name="mdiAccountCircle " color={color} size={26}/>
                }}} />
                <Tab.Screen name="گفت و گو" component={Chat} options={{tabBarIcon:({color,size})=>{
                    <MaterialCommunityIcons name="home" color={color} size={26}/>
                }}} />
                <Tab.Screen name="افزودن" component={Addd} options={{tabBarIcon:({color,size})=>{
                    <MaterialCommunityIcons name="home" color={color} size={26}/>
                }}} />
                <Tab.Screen name="جست و جو" component={SearchSecreen} options={{tabBarIcon:({color,size})=>{
                    <MaterialCommunityIcons name="magnify" color={color} size={26}/>
                }}} />
                <Tab.Screen name="پروفایل" component={Profilecreen} options={{tabBarIcon:({color,size})=>{
                    <MaterialCommunityIcons name="home" color={color} size={26}/>
                }}} />
                
                
            </Tab.Navigator>
            
        )
        
    }
}
...

在第27行,我使用了它,但它没有向我显示任何东西,请帮助我,我是新手

EN

回答 1

Stack Overflow用户

发布于 2021-02-08 15:04:08

尝试使用()而不是{},如下所示

代码语言:javascript
复制
  <Tab.Screen name="گفت و گو" component={Chat} options={{tabBarIcon:({color,size})=>(
            <MaterialCommunityIcons name="home" color={color} size={26}/>
            )}} />
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66096899

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档