问题
I am using TabBarIOS component in React native. If I press Command-R, the reload of the app is not happening. I use the "Shake Gesture" to show the menu and then click Reload on the context menu to reload the app.
Is there a way to get Command-R to work with TabBarIOS component in React native?
回答1:
When I had this problem, I had it from the beginning so it probably wasn't due to a specific component. However, it might work for you, too:
With the iOS Simulator in focus, select the menu item Hardware > Keyboard > Send Menu Keyboard Shortcuts to Device.
In addition, I use the Colemak keyboard layout and found that after making the selection above I also had to use the R as printed on my keyboard keys for the ⌘ + R command instead of the one I would use based on the Colemak layout.
回答2:
@burak-karasoy comments help me, I was building App in Release mode which does not allow hot reloading. To switch build you should go to the Product > Scheme > Edit Scheme and select Debug for Build Configuration.
回答3:
Have you tried checking the option, "Connect Hardware Keyboard". Under the Hardware -> Keyboard menu?
回答4:
Please try to press Command+K to toggle the software keyboard.
回答5:
first use ⇧+⌘+K
then use ⌘+R
hope it works
来源:https://stackoverflow.com/questions/39939831/reload-app-in-ios-simulator-using-command-r-not-working