我想将按钮放入表单中以获取当前位置,然后将值放入坐标中
我试过了,但它不起作用
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>
);
}
我只想把按钮放在表单中。怎么做?