For some reason when the orientation changes, I get a white box, which I am assuming is the place of the Drawer pre orientation change. Picture: Simulator Example
If I fully remove and re-render the Home component the white box will go away, but I would like to try and avoid that. I have tried passing height/width props when the dimensions change, but that didn't seem to fix the problem. Would be nice to get some help on this since I am stuck.
Related
I have used text input in creating a search bar on the 'HomeScreen'. Whenever I click on the search bar, it takes me to the 'SearchScreen' where text input is focussed.
In both screens, I have placeholder "Search" in the text input. The problem I am facing is that the placeholder flickers whenever screens are changed. This happens all the time if/when text input is re-rendered.
I want the placeholder to remain static there for smooth transition between screens. Please let me know if you have any idea on how to erect it or if you have any suggested workaround.
Take a look at this library Fluid Transitions. This library helps to create smooth transitions between screens and shared components. Thus, you can go from screen A to screen B maintaining you search bar input intact or at least keep it with a smooth transition.
Another idea is... Do you really need to move to another screen when focusing the search bar? Is it possible if you just create an SearchList component that "shows/hides" a FlatList (for example), when the user focus the search bar, it will change to another screen when the user clicks on a specific result.
I am using react-native-router-flux and here's some observation, previously I was using .replace() for switching scenes, this time I used .push(), customizing it to not show any animation and now search does not flicker when popping the search screen, however, it does flicker on pushing search screen onto the stack, seems like the re-render is causing flickering (as pop does not trigger a render but push does).
It's best to avoid using the placeholder as for now until the problem is sorted in react-native itself.
I watched this presentation and there's a section on how to build an IOS Maps like UI. When dragging from the bottom to top, it drags to the top, and after it reaches the top, it continues scrolling up. Also, when scrolling down, when it reached the top content of the ScrollView, it continues to drag down.
It is suggested that it can be done using ScrollView by adding an empty transparent cell as the first element on the ScrollView. I have tried implementing the same which can be found in this snack. In my case, instead of Maps, I am using another ScrollView.
But the problem is that the first element (transparent element) does not allow to interact with the First ScrollView elements. I have tried with pointerEvents inside the first transparent view and even in its parent ScrollView. But this does not help. Has anyone tried implementing this kind of use case with react-native? All I found was this library, but I think it's not maintained properly.
you need to set the z-index of the transparent view to send it under/behind the interactive content, here is a good resource:
https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
Edit: Actually I could not accomplish it, it seems like everything inside a scrollview will always be behind or in front of other elements, it seems like you can't have part of the scrollview behind something else and another part in front of something else.
I have the same component in multiple screens, which I navigate to through React navigation. I'm using Tabnavigator.
On the first screen, the View containers move around if the text is too long. I have a fixed flex-size on my view containers, but it doesn't take that into consideration. The strange is, it's only on the first screen. A gif to show you what I mean.
https://gfycat.com/KaleidoscopicEasygoingApisdorsatalaboriosa
I have linked a Snack to show you my code:
https://snack.expo.io/#cronnay/show-inconsistency
I've checked if it's because of the scrollview I have, and I was inconsistent with my design on the scrollviews. but they all have the same styling.
What the heck is going on?
EDIT: Uploaded new gif that shows that I navigate to same component through two different ways. And it makes the design screw up.
https://gfycat.com/HappyPracticalAustralianfreshwatercrocodile
In my react-native android app, This is the same text box in portrait & Landscape views.
I have used selectionColor & underlineColorAndroid properties to set the font color.
<TextInput selectionColor={FormElements.textInputSelectionColor} underlineColorAndroid={FormElements.textInputSelectionColor} placeholder={"Email Address"} placeholderTextColor={FormElements.textInputPlaceholderColor} keyboardType="email-address" value={this.props.email}/>
But the issue is in the full screen edit (on landscape mode) it's hard to read in white background.
So I want either to change make full screen edit background color or text color back to black on full screen.
I tried, but couldn't find a solution yet.
Cam someone please give me a solution for this?
This full screen popup doesn't come up only landscape mode. it comes up when ever there is not enough space to occupy the keyboard.
I was encountering this issue too. After a few hours of exploring I found this property of React Native TextInput "disableFullscreenUI"
In my case I only want the normal input editing and don't show the Fullscreen editor.
<TextInput disableFullscreenUI={true} />
and the fullscreen mode will go away upon edit then the editing will remain inside the TextInput.
Hope this helps
There are libs such as react-native-orientation https://github.com/yamill/react-native-orientation/ which allow you to check if the user changed the screen orientation. It would be possible to apply different styles based on the orientation.
However, for the scenario you mentioned, I don't think it would be user friendly to change colors depending on the orientation. I'd recommend you to use a standard color combination that looks fine in all resolution and orientations.
Hope it helps.
This was an issue with RN. I have updated my app to RN V50.0 (earlier it was V47.0). Now the above issue is not there anymore. TextBox shows black color fonts when it's popped up.
Not sure if this is a huge issue, but I am not completely sure a solution exists to this.
When creating a slideshow style element, where upon tap you image changes to another image (already prefetched using React Native's image prefetcher) there is this white flash when the screen re-renders (I think?).
Has there been a concrete solution to this? I can't figure out how something like say a snapchat story manages to render a new image completely instant
Has anyone ever done this? is the strategy to just load one image on top of another?