react-native-android

borderRadius not applied on FlatList

﹥>﹥吖頭↗ 提交于 2020-02-04 04:42:26
问题 I have a FlatList that gets displayed whenever someone inputs text in a TextInput. The issue that I'm facing is that borderRadius is applied on iOS, but not on Android (see what I mean at https://gitlab.com/narcis11/jobzy/uploads/2377b0617461a1ce35e3ae249b28c93c/rounded-edges.png ). The screenshot is from a Google Pixel emulator running API 28. I am running on Expo 33, which is based on React Native 0.59.8. I've tried the following: Setting borderRadius={6} as a parameter in the FlatList, not

Unfocus a TextInput in React Native

喜欢而已 提交于 2020-01-31 06:11:45
问题 I'm building an Android app with React Native. How can you force a TextInput to "unFocus", meaning the cursor is blinking inside the text field. There are functions for isFocused() and onFocus() , but how do I actually get the text field to give up focus. You would think it does so automatically once I hit enter, but that's not the case. import React, {Component} from 'react'; import { AppRegistry, Text, View, StyleSheet, TextInput, TouchableOpacity} from 'react-native'; var SHA256 = require(

Unable to post properly to php sever - React Native

北慕城南 提交于 2020-01-25 09:43:07
问题 I am having issues posting data to php server. Here is a snapshot of my code. Sometimes it works and post successfully and sometimes it does not. < TouchableOpacity style = {{ fontSize: 18, color: 'white' }} containerStyle = {{ padding: 8, marginLeft: 70, marginRight: 70, height: 40, borderRadius: 6, backgroundColor: 'mediumseagreen' }} onPress = {() => { if (this.state.newTodo == "") { alert("Please enter a reason for appointment"); return false } var query = { Reason: this.state.newTodo,

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 Navigation Preventing Going back to loading screen, reset not working

為{幸葍}努か 提交于 2020-01-21 14:25:56
问题 I have a React Native application which I have implemented. Currently the app opens up on a loading screen which after mounting checks the firebase.auth().onAuthStateChanged(...) feature. The app basically decides whether or not to got to the login screen or to main screen depending on whether or not the user is already authenticated. It is implemented like this: Main Navigator: const MainNavigator = TabNavigator({ auth: { screen: TabNavigator({ login: { screen: LoginScreen }, signup: {

React Native: Invariant Violation: The navigation prop is missing for this navigator

折月煮酒 提交于 2020-01-21 09:41:47
问题 My code is as follows: import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View} from 'react-native'; import {LoginNavigator} from './src/components/login/LoginNavigator' import {MainNavigator} from './src/components/main/MainNavigator' import FBSDK from 'react-native-fbsdk' import {createSwitchNavigator} from 'react-navigation' const { AccessToken } = FBSDK export default class App extends Component { constructor(props) { super(props) this.state = { accessToken: null

Load custom native component in react native using expo kit

ⅰ亾dé卋堺 提交于 2020-01-21 06:20:07
问题 Im trying to load a custom Android WebView to be able to upload files using html file inputs (by default Android webview wont work with input file). Im using this code, the only difference is that im using expo kit, so my MainApplication.java is different (inherits from another class by default): public class MainApplication extends MultiDexApplication { // Needed for `react-native link` public List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new

TouchableHighlight press error

落爺英雄遲暮 提交于 2020-01-17 07:01:11
问题 I'm new to react-native, I'm just trying to play around with actions and states. I don't get where's the problem in this component. I get the error undefined is not an object (evaluating 'this.wrappedInstance.setNativeProps') import React, { Component } from 'react'; import { Container, Text } from 'native-base'; import { AppRegistry, View, TouchableHighlight } from 'react-native'; export default class Page2 extends Component { constructor(){ super(); this.state = { mess: "Page 2 message" } }

How do I call the openDrawer function on DrawerLayoutAndroid from parent component?

本小妞迷上赌 提交于 2020-01-17 06:35:10
问题 I have made a component which sets up the DrawerLayoutAndroid, which I want to call in my index file. drawer.js: export default class MenuDrawer extends Component { constructor(props) { super(props); this.openDrawer = this.openDrawer.bind(this); } render() { var navigationView = ( // ... ); return ( <DrawerLayoutAndroid ref={(_drawer) => this.drawer = _drawer} drawerWidth={200} drawerPosition={DrawerLayoutAndroid.positions.Left} renderNavigationView={() => navigationView}> {this.props

React Native Android Clipping Children

让人想犯罪 __ 提交于 2020-01-17 01:11:11
问题 I am creating a react native app using expo, and I am creating a dropdown in the header. On iOS the dropdown works as desired, and goes 'above' the main content, while on Android it is clipped or goes 'under'. I am not sure if in reality iOS is acting strange, or Android is. The header is a custom headerTitle component, which holds the custom dropdown component (a view, which holds the dropdown items (Views with text and icons) I am looking to get around this issue, and I have tried zIndex