react-native-android

React Native - how to scroll a ScrollView to a given location after navigation from another screen

ぃ、小莉子 提交于 2020-01-01 05:28:06
问题 Is it possible to tell a ScrollView to scroll to a specific position when we just navigated to the current screen via StackNavigator? I have two screens; Menu and Items. The Menu is a list of Buttons, one for each item. The Items screen contain a Carousel built using ScrollView with the picture and detailed description of each Item. When I click on a button in the Menu screen, I want to navigate to the Items screen, and automatically scroll to the Item that the button represent. I read that

How to provide Picker a default “Please select…” option?

南楼画角 提交于 2020-01-01 02:45:28
问题 I'd like to make my Picker to show a "default option" on startup. That means: something like "Please select an option". I've tried to add a option manually with this phrase, but, this way the "default option" can be re-selected after selecting other options, like it was one of the real options. There is some way to do this? <View style={Styles.row}> <Picker selectedValue={this.state.initialOption} onValueChange={this.handleChangeOption} prompt='Options'} > <Picker.Item label='Please select an

How can I upgrade react-native gradle version

一世执手 提交于 2020-01-01 02:10:11
问题 I need help. I can't upgrade gradle version of my react-native project. I try a lot of things, downloaded last version of Android Studio & SDK Tools etc. I changed this file \android\gradle\wrapper\gradle-wrapper.properties, I tried to upgrade using npm install -g react-native-git-upgrade but still I can't upgrade it. When I react-native eject It's exports " distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip " Waiting for answers. 回答1: In android/build.gradle you

react-native run-android builds an old version of the code onto device

回眸只為那壹抹淺笑 提交于 2019-12-31 21:45:47
问题 This occurs in both production and dev builds. I can connect to the dev server, reload, and the new code is built and runs on the device. Step-by-step of what I have tried: Modify code. Re-bundle: react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res ./gradlew clean react-native run-android - Builds old version react-native run-android --variant=release - Builds old

What is the best way to schedule a task in react native?

本小妞迷上赌 提交于 2019-12-31 09:16:14
问题 There are different ways to run tasks in the background in Android and iOS respectively. I have found What is the best way to schedule task in android? as well on stack overflow. I am wondering which is the best way using react-native only. Would it be good enough to use setInterval or setTimeout for tasks that have to run daily or every few hours? Would not those tasks be killed by the OS? Any ideas or suggestions? 回答1: I will answer my own question to see if this information can be of used

React-Native “Could no connect to development server” in createReactContext()

假装没事ソ 提交于 2019-12-31 07:38:06
问题 My Android react-native app is crashing with an ExecutionException . "Could not connect to development server." The method that is crashing is ReactInstanceManagerImpl.createReactContext() . But this is not the normal error as this screenshot shows: Logcat shows me this stacktrace: Exception in native call from JS java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server. at com.facebook.react

React Native Debug Menu does not open - Android CMD + M

淺唱寂寞╮ 提交于 2019-12-31 01:58:06
问题 React native debug menu does not work in Android. Command 'RR' does work. CMD + M does not work. It was working previously. Keyboard input is enabled in AVD Manager. 回答1: There is an obscure setting only available after opening the emulator. Toggle Send keyboard shortcuts to : Emulator Controls (default) I have no idea why this was so hard to find. Hopefully you reap the benefits of my stress and heartache. I wish you the best Christmas in 2017 and that 2018 is great for you. 来源: https:/

Expo LAN configuration doesn't work for New ReactNative Project

99封情书 提交于 2019-12-30 03:10:27
问题 I have seen similar questions on Stackoverflow but none sorted the problem. I have just created new ReactNative project from Expo desktop app. But I can not run it on my Android phone via QR code scan when Expo configuration is set to LAN mode. Which seems not accessible on my Android phone (looks like). My phone is on same Wifi network. I have also tried to run Expo demo app by turning off Firewalls but still no success. I'm sure your one technical look might soft my issue. Note: The Expo

RecyclerView won't update child until I scroll

我与影子孤独终老i 提交于 2019-12-28 18:52:34
问题 I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this. I'm implementing a RecyclerView here and I can't for the life of me update it's children. What happens is that after I update nothing changes on the screen, UNLESS I start scrolling. Once I scroll it updates perfectly . This is my code: public void updateDataAtIndex(final int indexToUpdate, ReadableMap

RecyclerView won't update child until I scroll

[亡魂溺海] 提交于 2019-12-28 18:50:13
问题 I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this. I'm implementing a RecyclerView here and I can't for the life of me update it's children. What happens is that after I update nothing changes on the screen, UNLESS I start scrolling. Once I scroll it updates perfectly . This is my code: public void updateDataAtIndex(final int indexToUpdate, ReadableMap