react-native-ios

How to open iOS gallery app from React Native app

流过昼夜 提交于 2020-04-11 03:37:43
问题 I'm having trouble opening iOS gallery app from React Native app. I have the file url and asset url. I got the asset url from CameraRoll. Now I want to open the gallery itself to see the image. This is the code that I use openGallery = () => { // this code is working on android using asset url // sample url on iOS // file url : file:///var/mobile/Containers/Data/Application/A41FFC2E-06D4-445D-9B94-D21E885930C7/Documents/video/popcam-1527202811.mov // asset url : assets-library://asset/asset

FlatList ScrollView Error on any State Change - Invariant Violation: Changing onViewableItemsChanged on the fly is not supported

吃可爱长大的小学妹 提交于 2020-04-10 03:28:25
问题 onViewableItemsChanged does not seem to work when there is a state change in the app. Is this correct? Seems like it wouldn't be very useful if this were the case.... Otherwise, users will be forced to us onScroll in order to determine position or something similar... Steps to Reproduce Please refer to snack Repo has also been uploaded at github Any state change produces an error when using onViewableItemsChanged What does this error even mean? Note: Placing the onViewableItemsChanged

Block/Disable tabs in TabNavigator - react-navigation

筅森魡賤 提交于 2020-03-01 04:44:37
问题 I have a TabNavigator as shown in the picture. Header Image I am using TabNavigator for creating these tabs as below. const Tab_Navigator = TabNavigator({ First:{ screen: First, }, Second:{ screen: Second, }, Third:{ screen: Third, }, Now I want to block/disable "Second" and "Third" tabs. It should be visible but one shouldn't able to navigate to them. I tried blocking these tabs as shown here but I guess I am missing something. My try: Tab_Navigator.router.getStateForAction = (action, state)

react-native - How to display map using react-native-maps

穿精又带淫゛_ 提交于 2020-02-07 08:40:19
问题 I am trying to display a Map View using react-native-maps. The component appears to be displaying except it is blank. Is it my stylesheet or am I calling the 'MapView' component right? Here is the code: var MapView = require('react-native-maps'); class Map extends React.Component { constructor(props) { super(props); this.state = { } } render() { return ( <View style={styles.container}> <MapView style={styles.map} initialRegion={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.0,

react-native - How to display map using react-native-maps

≯℡__Kan透↙ 提交于 2020-02-07 08:39:39
问题 I am trying to display a Map View using react-native-maps. The component appears to be displaying except it is blank. Is it my stylesheet or am I calling the 'MapView' component right? Here is the code: var MapView = require('react-native-maps'); class Map extends React.Component { constructor(props) { super(props); this.state = { } } render() { return ( <View style={styles.container}> <MapView style={styles.map} initialRegion={{ latitude: 37.78825, longitude: -122.4324, latitudeDelta: 0.0,

Convert Expo project to Original React Native project

空扰寡人 提交于 2020-01-23 19:01:06
问题 I did yarn run eject to eject but it gave me this warning Warning! We found at least one file where your project imports the Expo SDK I know I have some modules which use Expo API like this - await Expo.Font.loadAsync({ Roboto: require('native-base/Fonts/Roboto.ttf'), Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'), }); Now I want to convert this to React Native Components so that I can eject without any errors so that I get index.android.js & index.ios.js in the root folder

React-native loads local images with a delay

拥有回忆 提交于 2020-01-16 19:49:11
问题 I have a hybrid react-native app and I have some static images which are loaded from the bundle. In the app when I open a page containing the images, it shows a gray rectangle while the image is getting decoded. Here is some pics of what I mean: When the page loads, I can see the left image first and after a delay of ~0.2 seconds the right image fades in. I have searched for this issue and I can't find any clean work arounds. This is the code I use to load the image: <Image style={{ height:

Unable to include AB Testing for React Native application

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-16 13:58:50
问题 I am integrating A/B Testing for my React Native application using Firebase. I have tried two methods - using react-native-ab and react-native-ab-test. In the first case, I get an error saying "undefined is not an object(evaluating PropTypes.string)" In the second case, I get an error saying "index.ios.js tries to require 'react-native' but there are several files providing this module. You can delete or fix them." In both the cases, I get these errors just by importing the dependency in my

Detect if shift key is down React Native

懵懂的女人 提交于 2020-01-14 05:54:24
问题 How can I detect if the shift key is currently pressed down? I have a text input, and when the user presses the enter key I only want to submit the form if they are not currently pressing the enter key (same form functionality as Facebook Messenger on desktop). Here is my text input: <TextInput style={styles.input} placeholder={'Enter message'} onKeyPress={this.handleKeyPress} /> And here is the handler: handleMessageInputKeyPress(e) { if(e.nativeEvent.key == "Enter"){ // Now check if the

Detect if shift key is down React Native

倖福魔咒の 提交于 2020-01-14 05:54:06
问题 How can I detect if the shift key is currently pressed down? I have a text input, and when the user presses the enter key I only want to submit the form if they are not currently pressing the enter key (same form functionality as Facebook Messenger on desktop). Here is my text input: <TextInput style={styles.input} placeholder={'Enter message'} onKeyPress={this.handleKeyPress} /> And here is the handler: handleMessageInputKeyPress(e) { if(e.nativeEvent.key == "Enter"){ // Now check if the