New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable the left-to-right transition animation during initial app launch? #50
Comments
I think you need to set |
Thanks @satya164 , but now it becomes this: I added "flex: 1"
btw, StackNavigator and DrawerNavigator don't have this issue. It's only TabNavigator. |
So seems it only happens when you've class HomeScreen extends React.Component {
render() {
return (
<View>
<View
style={{
flexDirection: 'row',
backgroundColor: 'red',
height: 300,
justifyContent: 'flex-end',
paddingTop: 30,
}}
>
<Text>Hello, Navigation!</Text>
</View>
</View>
);
}
} |
hmm ... I ran your code snippet, but it still doesn't work. The version that I'm using is "react-navigation": "^1.0.0-beta.1". Let me dig more ... |
@wenbinf hmm. I just tested this on simulator and couldn't reproduce the issue anymore. |
For the record, this was the environment that I tested
Just in case someone on the Internet encounters the same problem :) |
This is still an issue on latest master as of this post. When testing, please also use To reproduce, use a
I have tracked down the root cause, and it lies within the A not-so-practical workaround to avoid this animation issue would then be to somehow pass the tab navigator's width and height before mount. I tested this hypothesis by directly passing a hardcoded @satya164 Seems like you are 'the man to talk to' re |
We don't need that. The one frame delay is only for things like indicator which absolutely need the width before rendering. Tab view knows how to handle the layout before measurement is done, so that there is no delay. There were some missing styles in the scrollview based pager that iOS uses, which prevented it from working properly. I just pushed an update with fixed styles.
Debuggers often change the behaviour. So it's better not to use any debuggers while testing an issue. |
Fixed scrollview's style so it doesn't need layout satya164/react-native-tab-view@6ef48ed Fixes #50
Thanks! |
Then it works! Thanks a lot! @satya164 |
Fixed scrollview's style so it doesn't need layout satya164/react-native-tab-view@6ef48ed Fixes react-navigation#50
I use TabNavigator and here's the full code:
As you can see, when app initially launches, the text "flies" in ... How can I disable this effect?
Thanks in advance!
The text was updated successfully, but these errors were encountered: