【问题标题】:Nativebase Icons getImageSourceNativebase 图标 getImageSource
【发布时间】:2018-02-15 14:03:29
【问题描述】:

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

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

# 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]
        }
      ]
    });
  });

【问题讨论】:

    标签: reactjs react-native native-base


    【解决方案1】:

    是的,NativeBase 图标使用 React Native Vector Icons (RNVI) 如果可以在wix的react-native-navigation中使用RNVI的Icon.getImageSource,那么同样可以使用NativeBase的Icon

    检查Docs 是否相同

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-30
      • 1970-01-01
      相关资源
      最近更新 更多