2017-03-08 82 views
0

See the image陣營原住民們ShoutEm UI工具箱圖標不工作

在這裏你可以看到的圖標不會被加載。有人可以找到我的解決方案。

代碼內容:

import {Icon, Row} from '@shoutem/ui'; 

return (
      <View style={styles.container}> 
       <NavigationBar title="All Restaurants" /> 
       <View style={styles.row}> 
       <Row styleName="small" > 
        <Icon name="play"/> 
        <Text>About</Text> 
        <Icon styleName="disclosure" name="right-arrow"/> 
       </Row> 
       </View> 
      </View> 
     ); 
+0

這個問題與https:// github.com/shoutem/ui/issues/82這個問題非常相似。建議使用來自** shoutem **的'Text'組件而不是** react-naitve ** –

+0

否,它不起作用。我有問題與圖標,而不是文本組件。 –

+0

你如何運行項目?如果您不使用'shoutem' CLI,則必須在運行應用程序之前在項目根目錄中執行react-native link命令。 –

回答

0

也許是與裝載字體的問題。你可以檢查@ shoutem/ui的Github是否有類似的問題?有一個關於圖標顯示爲中文字母的圖標。你是否嘗試過使用其他圖標名稱?

1

對我來說,發生此問題是因爲字體文件不在您的react-native目錄的根目錄中的android/app/src/main/assests/font/文件夾中。

我將this link to shoutem's github中的所有字體文件(您也可以在您的項目目錄/ node_modules/@ shoutem/ui/examples/RestaurentsApp/android/app/src/main/assests/font /中找到)複製到上面的文件夾並重建應用程序。

這對我有用,我希望它也適合你。