Nativebase Icons getImageSource

时间:2018-02-14 19:45:02

标签: reactjs react-native native-base

由于Nativebase使用react-native-vector-icons,是否可以从Nativebase / getImageSource包装中Icon而无需单独安装/链接矢量图标?

我需要将图像源传递给Wix的react-native-navigation startTabBasedApp方法,例如:

# Using Icon from 'react-native-vector-icons/Ionicons';

Promise.all([
    Icon.getImageSource(Platform.OS === 'android' ? 'md-map' : 'ios-map', 30),
    Icon.getImageSource(Platform.OS === 'android' ?  'md-share-alt' : 'ios-share', 30),
    Icon.getImageSource(Platform.OS === 'android' ?  'md-menu' : 'ios-menu', 30)
  ]).then(sources => {
    Navigation.startTabBasedApp({
      tabs: [
        {
          screen: "myapp.Explore",
          label: "Explore",
          title: "Explore",
          icon: sources[0]
        }
      ]
    });
  });

1 个答案:

答案 0 :(得分:1)

是的,NativeBase Icon使用React Native Vector Icons(RNVI) 如果你可以在wix的react-native-navigation中使用RNVI的Icon.getImageSource,那么你也可以使用NativeBase的Icon来实现相同的

检查Docs是否相同