React Native Router Flux 自定义图标
React Native Router Flux custom Icon
这是我的第一个问题,如果我有任何错误,请原谅我。
我正在尝试使用 React native router flux 为 IOS 自定义导航栏图标,但我不知道如何检索我的自定义图标(png 文件)在某些示例中,他们使用 icon={tabIcon}像这样,但我需要做的是描述图像源的路径,但我不知道如何以正确的语法输入它。
如有任何帮助,我们将不胜感激。谢谢
这是我的代码:
<Scene key="root">
<Scene key="tabbar" tabs>
<Scene key="tab2" title="Categories" **icon={TabIcon}** >
<Scene key="categories" component={Categories} title="Categories" initial />
<Scene hideTabBar key="categorylisting" component={CategoryListing} title="Adventure" />
<Scene hideTabBar key="showdetails" component={ShowDetails} title="TV Show Details" />
</Scene>
文档里好像没有,不过是这样弄的
function CustomIcon(props) {
return (
<View>
<Image
source={iconSource}
style={{ width: 22, height: 25 }}
tintColor={'red'}
/>
<Text>Tab1</Text>
</View>
);
}
<Scene key="tab1" icon={CustomIcon} >
</Scene>
这是我的第一个问题,如果我有任何错误,请原谅我。
我正在尝试使用 React native router flux 为 IOS 自定义导航栏图标,但我不知道如何检索我的自定义图标(png 文件)在某些示例中,他们使用 icon={tabIcon}像这样,但我需要做的是描述图像源的路径,但我不知道如何以正确的语法输入它。
如有任何帮助,我们将不胜感激。谢谢
这是我的代码:
<Scene key="root">
<Scene key="tabbar" tabs>
<Scene key="tab2" title="Categories" **icon={TabIcon}** >
<Scene key="categories" component={Categories} title="Categories" initial />
<Scene hideTabBar key="categorylisting" component={CategoryListing} title="Adventure" />
<Scene hideTabBar key="showdetails" component={ShowDetails} title="TV Show Details" />
</Scene>
文档里好像没有,不过是这样弄的
function CustomIcon(props) {
return (
<View>
<Image
source={iconSource}
style={{ width: 22, height: 25 }}
tintColor={'red'}
/>
<Text>Tab1</Text>
</View>
);
}
<Scene key="tab1" icon={CustomIcon} >
</Scene>