0
私はListViewコンポーネントに焦点を当てています。ここ
は私のコードReact Native:どのようにListViewに焦点を当てることができますか?
class MyListView extends Component {
static propTypes = {
navigator: PropTypes.object.isRequired,
};
componentDidMount() {
this.listView.focus()
}
render() {
return (
<ListView
ref={ref => { this.listView = ref }}
contentContainerStyle={styles.listView}
dataSource={cloneWithRows(listDataSource)}
renderRow={(data) => <MyListViewCell
...
/>}
/>
)
}
}
export default MyListView
だが、それはちょうど私が記事の多くを検索した 「this.listView.focusは関数ではありません」が、私は解決策を見つけることができなかったようなエラーが返されます。
アイデア
'ListView'に' focus() 'メソッドがあると思いますか? – gus27
入力要素にのみフォーカスがあります。 – vijayst