react-native-ios

How to Set background image of DrawerNavigator in React-Native?

江枫思渺然 提交于 2019-12-06 05:52:33
问题 I integrate DrawerNavigator in my project. its working fine, but there are no any property to set background image. How can I will add background image in DrawerNavigator. DrawerNavigator Code of DrawerNavigation import { AppRegistry , Dimensions} from 'react-native'; import Library from './ViewControllers/Library'; import Language from './ViewControllers/Language'; import AboutUS from './ViewControllers/AboutUS'; import Support from './ViewControllers/Support'; import { DrawerNavigator }

Adjacent JSX elements must be wrapped in an enclosing tag

走远了吗. 提交于 2019-12-06 05:09:49
问题 I want to have a navigation bar at the bottom and a toolbar at the top of every page in my React-Native app. However, if I create these two elements in the index.ios.js file, I get the error: "Adjacent JSX elements must be wrapped in an enclosing tag". If I put tags surrounding the Navigator and NavBar I just see a blank screen in my app. What should I do? Here is what my render function looks like in index.ios.js render() { return ( <Navigator initialRoute={{name: 'Login'}} renderScene={this

Error screen with white background

笑着哭i 提交于 2019-12-06 03:49:38
问题 When getting an exception with React Native on iOS, I get this error screen with white background. You can see by the tapped cell that it actually has the exception stack, only with a white background. Not sure why's happening, but is there a way to fix? On Android the screen has red background (hence working as expected.) Running React Native 0.48.3. 回答1: Found out why it was happening (At least in my case) My team implemented a new launch screen as a .storyboard file, and that was causing

What is the default unit for width, height, padding etc in React Native for iOS?

。_饼干妹妹 提交于 2019-12-05 23:53:11
I am building a React Native application for iOS. The facebook documentation says width, height, padding, margin etc. takes a number. I wanted to know what the default unit of styling is. <View style={styles.box}> <Text style={styles.text}> Test Component </Text> </View> var styles = ReactNative.StyleSheet.create({ box: { padding: 10, width:100, height:100, }, text: { color: 'black', fontSize: 30, }, }); Gabriel Mesquita From the docs : All dimensions in React Native are unitless, and represent density-independent pixels. Setting dimensions this way is common for components that should always

How to go to specific native view controller from react-native code?

百般思念 提交于 2019-12-05 13:15:22
I'm a newbie in react-native. I'm adding one feature in react-native to an existing swift application. I presented the RCTRootview from my native view controller. From there when user clicks on back button I have to go to Homepage which is written in swift. How do I communicate from react-native to native application code. Can someone please help me with this scenerio. I stuck at this point from last 2 days. Thanks in advance. Yes. I found out the answer for this. It is all possible with RCTBridgeModule . This piece of code illustrate how to do that. #import "CalendarManager.h" #import <React

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

How to eject expo project to native code

送分小仙女□ 提交于 2019-12-05 05:24:39
I eject project from expo with command npm run eject . It generates 2 folders ios and android . I tried to run the project by xcode but it still display this error. Maybe I'm not clear how to run project after eject, can you help me run it. I run some statements to install pod , but cannot work https://github.com/CocoaPods/CocoaPods/issues/2303 So with ejecting, you should have been presented with two options: ? How would you like to eject from create-react-native-app? (Use arrow keys) ❯ React Native: I'd like a regular React Native project. ExpoKit: I'll create or log in with an Expo account

Expo XDE “timeout of 60000 ms exceeded”?

久未见 提交于 2019-12-05 03:24:59
I am using Expo XDE to create a new project for my first react native application. But whenever I click on "create new project", it starts downloading some stuff and errors out. Don't know where to increase this timeout value, I checked the documentation of expo but could not find anything related to this. Any leads here is really appreciated. Please note that I installed expo xde-2.22.0.dmg on mac OS High Sierra version 10.13 (17A405) Looks like someone reported this issue to expo after reading this question . An update to XDE is made that increases the timeout. Upgrading to XDE v2.22.1

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