相关疑难解决方法(0)

如何使用单个处理程序处理多个TextInput句柄?

我为TextInput创建了通用类,并多次使用了它,但是它的事件句柄具有相同的方法。我想在将数据填充到textInput中之后处理数组数据。

在这里添加了多个textField和single handleAddMore。如何识别哪个textInput称为handleAddMore

textField组件根据数组数据动态添加。现在,当用户编辑textInput时,我想在特定索引上标识textInput和更新的数组文本。

let addMoreCompView = this.state.dataAddMore.map((data ,index) =>{
 return(
   <View style ={[styles.commonMargin ,{flexDirection : 'row',marginTop : 2 , height : 40, backgroundColor : Globle.COLOR.INPUTCOLOR}]}>
     <View style = {{height : '100%' , width : '80%' , justifyContent: 'center' ,alignItems: 'flex-start', flexDirection : 'column'}}>
         <TextInput style = {{fontFamily: 'Gotham-Light',fontSize : 14 ,color: Globle.COLOR.BACKCOLOR , paddingLeft : 20}}
              underlineColorAndroid = "transparent"
              placeholder = 'Please enter emailID.'
              placeholderTextColor = 'black'
              autoCapitalize = "none"
              keyboardType = "email-address"
              onSubmitEditing ={Keyboard.dismiss}
              onChangeText …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native react-native-android react-native-ios react-native-0.46

3
推荐指数
1
解决办法
3792
查看次数

如何在ScrollView项目中绑定拖动视图?

我创建ScrollView了三个视图.而且我想绑定里面的拖动视图ScrollView,其余的没有拖放视图应该保持在外面ScrollView.怎么可能呢?

请参阅GIF:我想在ScrollView中添加d​​raggableView.

代码:

import React, { Component } from 'react';
import {
  StyleSheet,
  View,
  Text,
  PanResponder,
  Animated,
  Easing,
  Dimensions,
  Platform,
  TouchableOpacity,
  ScrollView,
} from 'react-native';
import Carousel from 'react-native-snap-carousel';


let CIRCLE_RADIUS = 36;
let Window = Dimensions.get('window');
const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' +
    'Cmd+D or shake for dev menu',
  android: 'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

export default …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native react-native-android react-native-ios

2
推荐指数
1
解决办法
747
查看次数