1
を使用しながらのonFocusコールバックとREFにアクセスここでコードのスニペットは、それがscrollViewを参照する必要がある場合にconsole.logプリントが} {オブジェクト私は<a href="https://github.com/gcanti/tcomb-form-native" rel="nofollow">https://github.com/gcanti/tcomb-form-native</a> &を使用していtcomb状ネイティブ
_renderScene(route, navigator) {
var Cook_time = {
onFocus:() => {
console.log('cook time has focus');
console.log(this.refs);
},
};
options.fields['Cook_time'] = Cook_time;
return (
<View style={{ flex: 1 }}>
<ScrollView style={styles.container} ref="scrollView">
<Form
ref="form"
type={Recipe}
options={options}
onChange={this.onChange}
onFocus={this.onChange}
/>
ありません私は何が欠けているのか確かめてください。そして、ここでフォーム自体
var Recipe = t.struct({
Recipe_name: t.String,
yield: t.maybe(t.String),
Prep_time: t.maybe(t.String),
Cook_time: t.maybe(t.String),
source: t.maybe(t.String),
})
var options = {
fields: {
yield: {
label: 'Yield',
},
Prep_time: {
label: 'Preparation time',
},
source: {
label: 'Source',
placeholder: 'family, friends, website ...',
onFocus: function() {
console.log('source has focus');
}
}
}
};