native-base

Conditional Rendering on Items of Native Base Picker [React Native]

怎甘沉沦 提交于 2019-12-06 15:35:49
I’m using ‘Native Base’ components for our product and going good with this, but I’m stuck at one point and it is around putting Items in Nativebase Picker. My code is like this Render Method code - render(){ return ( <View style={{marginTop: 20, flexDirection:'row', flexWrap:'wrap', justifyContent:'space-around', alignItems:'center'}}> <View style={{flex:1, justifyContent:'center', alignItems:'flex-end' }}> <Button style={{ backgroundColor: '#6FAF98', }} onPress={this._showDateTimePicker} > <Text>Select Date</Text> </Button> </View> <View style={{flex:1, justifyContent:'center', alignItems:

ComponentWillMount only trigger for first time?

牧云@^-^@ 提交于 2019-12-06 14:46:23
问题 MainComponent: <Tabs initialPage={this.props.day} tabBarUnderlineStyle={{ backgroundColor: '#5AF158' }} renderTabBar={() => <ScrollableTab />}> {this.renderTabHeader()} </Tabs> renderTabHeader() { return ( this.props.dateArray.map((date, i) => <Tab key={i} heading={date.format('DD/MM')} tabStyle={styles.tabStyling} activeTabStyle={styles.activeTabStyle} textStyle={styles.tabTextStyle} activeTextStyle={styles.activeTabTextStyle} > <View style={{ backgroundColor: '#EEEEEE', flex: 1 }}> <Content

undefined is not an object (evaluating 'RootComponent.prototype')

本小妞迷上赌 提交于 2019-12-05 10:11:59
---------index.js-------- import { AppRegistry } from 'react-native'; import Navigate from './Navigate'; AppRegistry.registerComponent('form1', () => Navigate); ----Navigate.js----- import React from 'react'; import { StackNavigator, DrawerNavigator } from 'react-navigation'; import TabsList from './TabsList'; export const StackTab1 = StackNavigator({ TabList: { screen: TabsList}, }); export const Navigate = DrawerNavigator( { Tab1: { screen : StackTab1 }, Tab2: { screen : StackTab1 }, Tab3: { screen : StackTab1 } }); Whenever I try to run my android simulator, I'm getting that error. All

Right to left for specific text in react-native RTL

谁说我不能喝 提交于 2019-12-05 09:30:53
I am developing app in arabic in react native , i have used the tabs and menu from native base. i have aligned right because there is only single word . but now i have to write sentence which is right to left aligned. Is there way to set RTL format for specific text because when i set the I18nManager.forceRTL(true); it changed it for whole app and my previous work is all ruined and tabs not work correctly . please help . The React Native version is 0.57 now, And there is no react native configuration for RTL support yet. But there is a native solution for it. for IOS and Android use below

Unrecognized font family ionicons

邮差的信 提交于 2019-12-05 03:43:16
I followed the setup instructions in the NativeBase Docs and ran rnpm link . I am getting this error: Unrecognized font family ionicons also checked by Xcode, the fonts are already in the build phase. What am I missing? Expanding on the exisiting answer and using the solution found on this github issue , do the following; Close the running packager Run react-native link react-native-vector-icons Then run react-native start --reset-cache Finally run react-native run-ios to restart the simulator For RN 0.60+ don't use react-native link ... ! (see Autolinking ) Instead add this in your Podfile :

ComponentWillMount only trigger for first time?

时光毁灭记忆、已成空白 提交于 2019-12-04 19:12:37
MainComponent: <Tabs initialPage={this.props.day} tabBarUnderlineStyle={{ backgroundColor: '#5AF158' }} renderTabBar={() => <ScrollableTab />}> {this.renderTabHeader()} </Tabs> renderTabHeader() { return ( this.props.dateArray.map((date, i) => <Tab key={i} heading={date.format('DD/MM')} tabStyle={styles.tabStyling} activeTabStyle={styles.activeTabStyle} textStyle={styles.tabTextStyle} activeTextStyle={styles.activeTabTextStyle} > <View style={{ backgroundColor: '#EEEEEE', flex: 1 }}> <Content contentDate={date.format('YYYY-MM-DD')} /> </View> </Tab> ) ); } Content Component: class Content

NativeBase + Exponent Header

眉间皱痕 提交于 2019-12-03 16:16:53
问题 I'm using NativeBase with Exponent. The Header goes beneath the phone's StatusBar. You can see this in the NativeBase demo that Exponent released. Does anyone have a fix for this? 回答1: Since this issue only comes up in Android, the recommended way to fix this would be to target Android specifically using Platform : import {Platform, StatusBar} from 'react-native' const styles = StyleSheet.create({ container: { flex: 1, ...Platform.select({ android: { marginTop: StatusBar.currentHeight } }) }

React NativeBase not showing my imported components

喜你入骨 提交于 2019-11-29 17:55:34
I'm fairly new to React and React Native and I'm having a play with React NativeBase. I've managed to get the following working within a single file, but now I'm simply trying to split up my code into multiple components in separate files. The problem is, my imported component does not show. I've struggled with this for a while now and I can't see what I'm doing wrong... probably something really stupid. Here is my code: code/index.ios.js import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; import { Container, Title, Header, } from

React Native have to double click for onPress to work

一世执手 提交于 2019-11-29 13:23:02
I'm using React Native with the Native Base library. I need an onPress event to fire on Native Base' ListItem (equivalent to TouchableOpacity) when the keyboard is open. I now have to click once to close the keyboard and then I can press the ListItem. Content tag below is equivalent to ScrollableView: <Content keyboardShouldPersistTaps='always' keyboardDismissMode='on-drag'> <List> <ListItem style={styles.inspectionsItemDivider} itemDivider> <TextInput autoFocus={true} ref={(input) => { this.titleSearch = input }} placeholder='Start typing...' multiline={true} onChangeText={this.setSearchText

Module AppRegistry is not registered callable module (calling runApplication)

别说谁变了你拦得住时间么 提交于 2019-11-29 01:05:56
I am using native base for making app in react-native. I am new to both things. When I run the app It gives me this error: Here is my code: export default class Point extends Component { render() { return ( <Container> <Header> <Left> <Button transparent> <Icon name='menu' /> </Button> </Left> <Body> <Title>Header</Title> </Body> <Right /> </Header> </Container> ); } } Here is the screenshot of my versions and nativebase version is "native-base": "^2.1.2" Just kill all node process and start npm server and run application: Step1: run command killall -9 node For windows users, run: taskkill /im