ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 416 forks source link

How to disable multi click to TabNavigator.Item #185

Open ahzorlu opened 5 years ago

ahzorlu commented 5 years ago

For Example, I have 2 page in my project, im using this libraries and TabNavigator.Item using for button, but multi click then it's a bad image, i want to clicked button after a click passive get, disable maybe. do you have an idea, I examined library but not found.

import TabNavigator from 'react-native-tab-navigator';

<TabNavigator style={styles.container} hidesTabTouch={true}>
                <TabNavigator.Item
                    selected={this.state.selectedTab === 'home'}
                    selectedTitleStyle={{color: "#3496f0"}}
                    renderIcon={() => <Icon name="home" size={px2dp(26)} color="#666"/>}
                    renderSelectedIcon={() => <Icon name="home" size={px2dp(26)} color="#3496f0"/>}
                    onPress={() =>this.homeOnclick()}>
                    <MainAppScreen ref={(ref) => { this.mainAppScreen = ref; }}/>
                </TabNavigator.Item>

                <TabNavigator.Item
                    selected={this.state.selectedTab === 'addwall'}
                    selectedTitleStyle={{color: "#3496f0"}}
                    renderIcon={() => <Icon name="camera-alt" size={px2dp(26)} color="#666"/>}
                    renderSelectedIcon={() => <Icon name="camera-alt" size={px2dp(26)} color="#3496f0"/>}
                    onPress={() => this.cameraOnclick()}>
                    <AddWallpaperScreen ref={(ref) => { this.addWallpaperScreen = ref; }}
                                        updateHome = {this.updateHome}/>
                </TabNavigator.Item>
 </TabNavigator>
ahzorlu commented 5 years ago

okay, done hidesTabTouch={true}

JohnnyDevX commented 5 years ago

close it