react-native-android

com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag

感情迁移 提交于 2019-12-05 19:18:41
com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag: 1122 How to resole this bug,How to find where cause this crash? This happened because of missing piece of code in ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java reactRootView.removeAllViews(); reactRootView.setId(View.NO_ID); This is fixed in RN 0.48.0 in c639a1f I managed to spot exactly what's causing that problem in react-native . So what happens behind the scenes is, react-native is trying to manipulate the shadowNode list at the same time some other thread is manipulating

android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@c745883 - permission denied

早过忘川 提交于 2019-12-05 13:57:49
问题 Here's my stack trace: 01-30 15:11:41.037 13010-13010/project.app E/AndroidRuntime: FATAL EXCEPTION: main Process: project.app, PID: 13010 android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@c745883 -- permission denied for window type 2003 at android.view.ViewRootImpl.setView(ViewRootImpl.java:789) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93) at android

How can I call method from onPress on Alert function [React-Native]

一曲冷凌霜 提交于 2019-12-05 13:10:22
问题 How can I call method from onPress on Alert function [React-Native] <Button onPress={{() => Alert.alert( 'Alert Title', 'alertMessage', [ {text: 'Cancel', onPress: () => console.log('Cancel Pressed!')}, {text: 'OK', onPress: () => {this.onDeleteBTN}}, ], { cancelable: false } )}} > <Text> Delete Record </Text> </Button> After OK button on Alert Dialog I need to call onDeleteBTN = () => { alert(' OnDelete'); } {text: 'OK', onPress: () => {this.onDeleteBTN.bind(this)}}, {text: 'OK', onPress: ()

Select a row in ListView react-native to get detail

我怕爱的太早我们不能终老 提交于 2019-12-05 13:06:55
i'm new in react-native. I saw an example in https://facebook.github.io/react-native/docs/sample-application-movies.html . It is building a movies app that fetch movies and display them in a ListView. How can we select a row to get its detail data and display it in other view? Please help. thanks :) Here's what i've done so far: /** * Sample React Native App * https://github.com/facebook/react-native */ import React, { Component, } from 'react'; import { AppRegistry, Image, ListView, StyleSheet, Text, View, Navigator, TouchableOpacity, } from 'react-native'; var REQUEST_URL = 'https://raw

Got 'One of the sources for assign has an enumerable key on the prototype chain' on React native app

别说谁变了你拦得住时间么 提交于 2019-12-05 10:42:31
I am using react-native for Android app. And use axios as http library. When I try to send a Blob object through http post I will get below error: HTTP Failure in Axios TypeError: One of the sources for assign has an enumerable key on the prototype chain. Are you trying to assign a prototype property? We don't allow it, as this is an edge case that we do not support. This error is a performance optimization and not spec compliant. Below is the code I used to add blob object on form data: let data = new FormData() data.append('image', decodeBase64Image(image)); below is the code to decode

ReactNative ListView inconsistent separator lines

限于喜欢 提交于 2019-12-05 05:47:52
On Android 4.4, ListView separator lines are inconsistent in thickness, and some do not render. I can't see how this can be a code issue, this is how I render them: separator: { height: 1, backgroundColor: 'grey', } ... <ListView renderSeparator={(sectionID, rowID) => <View key={`${sectionID}-${rowID}`} style={styles.separator} /> } .../> Here is a screenshot of a View with this problem: This issue does not happen on iOS or Android 6. Anyone had this problem before? Update I did a test, this is not Android4 issue. It happens on all API version when running on Nexus One device (in android

In React Native how to Store values in session?

£可爱£侵袭症+ 提交于 2019-12-05 02:19:11
问题 In React Native how to Store values in session ? I need to store login details (Username , Password) in session . Could you Please Give any ideas. 回答1: Use AsyncStorage . Example: For save: AsyncStorage.multiSet([ ["email", userInfo.email], ["password", userInfo.password] ]) For Delete: let keys = ['email', 'password']; AsyncStorage.multiRemove(keys, (err) => { console.log('Local storage user info removed!'); }); For Get: AsyncStorage.multiGet(['email', 'password']).then((data) => { let email

What is the purpose of FlatViewManager in react native android?

北战南征 提交于 2019-12-04 20:53:52
As far as my understanding, FlatViewManager would flat all its children and itself as a single view called FlatViewGroup. But then I found RCTTextManager return RCTText as its shadow nodes and RCTText is not a virtual node. So RCTTextManager will return FlatViewGroup as its viewInstance? And will there be view hierarchy in FlatViewGroup? I am not sure what the meaning of flat is. Your understanding is correct, but there is something you are missing. FlatViewGroup doesn't do or draw anything by itself. You can notice that every View is actually a FlatViewGroup (Text, Image, View - everything

Scroll View inside view not working react native

北城余情 提交于 2019-12-04 17:16:34
问题 Here I am trying a simple code but the scroll view is not working if kept inside another view. Code is like this: return( <View> <Toolbar title={this.props.title}> </Toolbar> <ScrollView> <HomeScreenTop /> <HomeScreenBottom navigator={navigator}/> </ScrollView> </View> ); But if scroll view kept as parent view it works perfectly. Code is as below: return( <ScrollView> <Toolbar title={this.props.title}> </Toolbar> <HomeScreenTop /> <HomeScreenBottom navigator={navigator}/> </ScrollView> ); Now

How To Add More component dynamically React Native

狂风中的少年 提交于 2019-12-04 17:02:42
I want to add more components after clicking on the button. Can you share code or an idea so that I can implement? As the image shows, every time when user click on the add button, one row / component will be added. It's where state shining of, for example: constructor(props) { super(props); this._handleAddButton = this._handleAddButton.bind(this); this.state = { /* initial your state. without any added component */ data: [] } } _handleAddButton() { let newly_added_data = { title: 'new title', content: 'new content goes here' }; this.setState({ data: [...this.state.data, newly_added_data] });