-
Notifications
You must be signed in to change notification settings - Fork 67
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
Padding Issues #29
Comments
I think it's something to do with how React Native handles content offsets, which are almost always a pain in the butt. I actually encountered this in one of our apps yesterday but didn't investigate further... can you try setting |
Reading the docs though, I am not sure why this flag works:
What is being (improperly) adjusted for? |
It's supposed to be smart and adjust content insets to make way for native UINavigationControllers and UITabBarControllers but often ends up being confusing. It's simpler to set the height of the navbar/tabbar and top/bottom inset yourself. In this case I think it's trying to add 20px to the top inset to make way for the status bar. My recommended solution is just to add the 20px yourself to start with, and later write a tiny native module that listens to changes to the status bar frame, sends those events to JS, and then have your app code change the top padding of your scroll bar accordingly (haven't actually done this last part myself since even Apple doesn't handle status bar changes sometimes lol). (FYI ListViews wrap ScrollViews and pass many of its props down.) |
What confused me is why the auto-adjustment applies on the initial route but not on subsequent routes. Especially since we are not using NavigatorIOS, I would think that RN should see the same native controls in both cases. I did find this project: https://github.com/brentvatne/react-native-status-bar-size though I am confused because even though I don't use that project / respond to changes in the size of the status bar, when I toggle "in-call status bar", the padding looks ok: |
@ide The problem with setting |
I recommend giving the ListView a bottom inset or bottom padding manually. Not sure what ExNavigator can do here. The best handling of insets I've seen is Apple's layout guides and it's a kind of narrow-minded API like a lot of Apple APIs so I don't think we want to take that approach (and would require patching React Native, plus coming up with a way to make it work on Android). So my suggestion is to adjust the insets yourself. |
I don't really understand why the first route on the ExNavigator has issues but subsequent routes do not. |
The padding on the top seems to change on subsequent routes:
![image](https://cloud.githubusercontent.com/assets/51059/11072194/b6db4700-87b2-11e5-9c74-918fc17c722a.png)
![image](https://cloud.githubusercontent.com/assets/51059/11072198/c1ffd506-87b2-11e5-98dc-a171ab6cca9a.png)
initial:
second:
and then I wire up
goToAddDevice
to push the same route:The text was updated successfully, but these errors were encountered: