【发布时间】:2019-09-10 10:23:27
【问题描述】:
我想将按钮放入表单中以获取当前位置,然后将值放入坐标中
我试过了,但是没用
const validForm = t.struct({
coordinate: t.maybe(t.String),
buttoncoordinate: t.maybe(t.String),
});
let options = {
i18n: {
optional: '',
required: ' *'
},
fields: {
coordinate: {
label: 'coordinate',
stylesheet : textInput,
},
buttoncoordinate:{
label:'',
stylesheet : textInput,
factory: props => (<Button{...props} onPress={() => console.log('pressed')} />
),
},
}
};
render() {
return (
<View style={styles.formInput}>
<Form
ref="form"
type={validForm}
options={options}
value={this.state.value}
onChange={this._onChange}
/>
</View>
);
}
我只想将按钮放入表单中。如何制作?
【问题讨论】:
标签: react-native react-native-android tcomb-form-native tcomb