2016-10-03 49 views
1

我是React原生初學者 我使用http://nativebase.io/作爲我的示例 但我遇到了圖標問題。 我的應用程序不顯示圖標無法加載React原生圖標

  • 我的應用:

enter image description here

  • 代碼:

/** 
 
* Sample React Native App 
 
* https://github.com/facebook/react-native 
 
* @flow 
 
*/ 
 

 
import React, { Component } from 'react'; 
 
import { AppRegistry } from 'react-native'; 
 
import { Container,Header,Content,Title,Badge,Tabs,Button,Icon} from 'native-base'; 
 
import Com_DetailCook from './component/Com_DetailCook'; 
 

 
class CookApp extends Component { 
 
    render() { 
 
     return (
 
      <Container> 
 
       <Header> 
 
        <Button transparent> 
 
         <Icon name='ios-arrow-back' /> 
 
        </Button> 
 

 
        <Title>CookApp</Title> 
 

 
        <Button transparent> 
 
         <Icon name='ios-menu' /> 
 
        </Button> 
 
       </Header> 
 

 
       <Content> 
 
         <Com_DetailCook/> 
 
       </Content> 
 

 
      </Container> 
 
     ); 
 
    } 
 
} 
 

 

 
AppRegistry.registerComponent('CookApp',() => CookApp);

  • 和配置圖標指南(github.com/oblador/react-native-vector-icons)

感謝您的幫助!

+0

所有圖標不起作用? – EQuimper

+0

是的。所有圖標不起作用。你可以看我的配置在圖像「我的應用:在這裏輸入圖像描述」 – NHT

+1

https://github.com/GeekyAnts/NativeBase/issues/76 – EQuimper

回答

0

從我已閱讀的react-native-vector-icons庫的問題。你需要手動安裝它,有時連接它不工作。

看看這個問題

的指南,安裝看看這裏的文檔https://github.com/oblador/react-native-vector-icons#option-manually

希望有所幫助;)

+1

謝謝大家。我解決了它 使用: ** rnpm鏈接react-native-vector-icons ** – NHT

+0

非常高興聽到;)幹得好 – EQuimper