当我单击选项卡时,我陷入了一个大问题,即我想要onPress事件。我的代码在这里:
static navigationOptions = ({navigation, screenProps}) => {
const params = navigation.state.params || {};
console.log("Params:-",params);
return {
title:Strings.title_dashboard,
headerStyle:{ backgroundColor: Colors.header_blue},
headerTitleStyle:HeaderStyle.titleCenter,
tabBarOnPress: (tab, jumpToIndex) => {
console.log("Tab Click",tab);
jumpToIndex(tab.index);
navigation.state.params.onFocus()
},
headerRight:<TouchableOpacity onPress={()=>Alert.alert(Strings.avanza,Strings.under_imple)}><View><Image source={{uri: "filter_icon"}} style={{height: 18, width: 18,marginRight:10,}} /></View></TouchableOpacity>,
}
}
Run Code Online (Sandbox Code Playgroud)
在这里,我在componentDidMount中设置如下参数:
this.props.navigation.setParams({
handleGrid: this.callServer.bind(this)
})
Run Code Online (Sandbox Code Playgroud)
在这里出现错误,无法获得此点击事件。
请帮帮我。
谢谢。
实际上,我陷入了一个有关日期的问题。
我想减去和加上反应本机中的日期。
有什么解决办法吗
我已经使用了Moment.js,但是其中发生错误,所以请帮助我。
先感谢您
希望你一切顺利。
我被困在一个小问题是我只想在我的条件成立时传递一个标签。
例如:
render(
return(
<View>
{
if(data==='test')
{
<Text>Hello this is Test Execution </Text>
}
}
</View>
)
)
Run Code Online (Sandbox Code Playgroud)
我想做完全像上面的例子。
我遇到了一些错误,我无法理解该怎么做,请帮助我。
谢谢
react-native ×3