react-native-android

How to render items in two columns in react native?

让人想犯罪 __ 提交于 2020-01-06 06:45:46
问题 my skills in react native is basic, so i want to render items in two columns, i'm using this library https://github.com/GeekyAnts/react-native-easy-grid. componentDidMount() { return fetch(ConfigApp.URL+'json/data_posts.php') .then((response) => response.json()) .then((responseJson) => { this.setState({ isLoading: false, dataSource: responseJson }, function() { }); }) .catch((error) => { console.error(error); }); } Return return ( <Grid> <Col><FlatList data={ this.state.dataSource }

How can I create or delete tabs in React Navigation based on the data fetched from API?

心已入冬 提交于 2020-01-06 04:37:04
问题 Let's say there is a tab view which has tabs with names Breads, Pizzas, Beverages, Desserts, Shakes. And the name of these tabs are fetched from API. Also, the information for each tab to show on their respective screens is fetched from the API too. Now, when one of the Tab's data gets deleted from the API. I want it to be removed from the Tab View too. How can I achieve this in React Navigation? 回答1: In react navigation we cannot have dynamic tab, as we have to define all the routes

React Native Http request dont work in Android

非 Y 不嫁゛ 提交于 2020-01-06 02:23:08
问题 Working with requests to the server using Fetch and also using Axios , when running it on Android emulator/devise it shows me the following error: this is the request code: fetch(URL,{ method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ email: userEmail, password: userPassword }), }) .then((response) => response.json()) .then((responseJson)=>{ Alert.alert("bien"); console.warn(responseJson); }) .catch((error)=>{ console.error

React Native Null Reference - Maps & Markers (Android)

巧了我就是萌 提交于 2020-01-05 05:30:27
问题 Hey Guys Iam getting an error on my Android Devices. On Iphone it works very well I'am getting my Markers in maps but on Android iam getting this Error Click for the Image Since i upgraded the Code with geolib where iam filtering markers out which are not near to me it won't work on Android... Anybody an idea? this is my Code: import React from 'react'; import MapView from 'react-native-maps'; import Marker from 'react-native-maps'; import Geolib from 'geolib'; import { View, Text, StyleSheet

What is the equivalent of Java singleton in React Native?

混江龙づ霸主 提交于 2020-01-05 05:10:24
问题 Actually I am a Android Native Developer. I am new to React-Native. In Java i keep the users data and others data in Singleton Class and access from other activities. Then how i achieve this process in React native for access data's from other components or any alternative of singleton in React native. I just try this but i received the error like getInstance() not defined. class AppDelegate { log = "This is AppDelegate"; static myInstance = null; static getInstance() { if (AppDelegate

How can I remove Alert prompts programmatically?

喜欢而已 提交于 2020-01-05 04:38:09
问题 On a button click, I start a process that takes sometime and once it gets finished I navigate to a specified screen. While under process, I Alert a " loading " prompt which according to the docs: " By default, the only button will be an 'OK' button" . And once the process is done, I alert again that the data is ready. Problem is that I get two prompts above each other, and that they need user's click to be removed. I would like to remove the first prompt before displaying the second (and

How to create CallBack method to get value from another JS?

試著忘記壹切 提交于 2020-01-05 04:22:23
问题 I have create CustomDatePicker.JS file for datePicker, for Android use the DatePickerAndroid and for ios use DatePickerIOS , and its use in my another Profile.js file. I use like below. <CustomDatePicker ref='modal'></CustomDatePicker> Now whenever will select the date, CustomDatePicker.JS class get the value but I want to the date value in Profile.js . So how can get date value in profile. CustomDatePicker.JS : Here Will get date and time log. Profile.js : Want to date which is selected on

Connection Refused Error at Run ReactNative Project

两盒软妹~` 提交于 2020-01-04 13:59:12
问题 I create new react-native project with command: react-native init myProject But When I want run it on emulator or real device with this command: react-native run-android I got this error and app not build: FAILURE: Build failed with an exception. * What went wrong: fresco/1.10.0/fresco-1.10.0.pom'. > Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/fresco /1.10.0/fresco-1.10.0.pom'. > Connect to 127.0.0.1:9595 [/127.0.0.1] failed: Connection refused: connect In build.gradle I

Using FabricJS With React-Native

百般思念 提交于 2020-01-04 13:46:21
问题 I have an application which is built on a ReactJS and uses FabricJS extensively. We plan to reuse a lot of code and build mobile apps using React-Native but I am not sure how we can integrate the FabricJS component into it. The app is something like https://www.my-wallsticker.de/wandtattoo-selber-gestalten/ I have found and used https://www.npmjs.com/package/react-fabricjs but nothing available for React-Native. What could be the solution? 回答1: You would have to use a WebView with canvas (or

React Native KeyboardAwareScrollView doesn't work

醉酒当歌 提交于 2020-01-04 07:48:09
问题 I'm trying to use the react-native-keyboard-aware-scroll-view library (0.2.7). It does absolutely nothing for me. What am I doing wrong? import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' render() { return ( <KeyboardAwareScrollView> <View> <TextInput placeholder='hi1' /> <TextInput placeholder='hi2' /> <TextInput placeholder='hi3' /> <TextInput placeholder='hi4' /> <TextInput placeholder='hi5' /> <TextInput placeholder='hi6' /> <TextInput placeholder='hi7' /> <