2016-09-06 35 views
1

我在iOS模擬器和實際設備中都有此問題。 我有一個ListView與Touchablehighlight。當我首先按下列表時,它會忽略。它只在雙擊時才起作用。任何人都可以幫助我解決這個問題。 在這裏,我有一段代碼,這是我的渲染函數內在Listview中反應原生TouchableHighlight忽略第一次單擊事件

<ListView dataSource= {ds.cloneWithRows(this.state.searchedAdresses)} 
      renderRow={this.renderAdress} 
      renderSeparator={this._renderSeperator} 
      enableEmptySections={true} 
      automaticallyAdjustContentInsets={false} 
      /> 



renderAdress = (rowData, sectionID, rowID) => { 
return (
<TouchableHighlight onPress = {this._onPressAddressList.bind(this,rowData.place_id,rowData.description)}underlayColor = '#a9a9a9' > 
<View shouldRasterizeIOS={true} renderToHardwareTextureAndroid={true}> 
    <Text style={ styles.listTextInput } >{rowData.description</Text> 
</View> 
</TouchableHighlight> 
);}; 

謝謝

回答

0

我能想到的兩種情況:

  1. 你有TextInput獲得的焦點,當在第一次從輸入中移除焦點並隱藏鍵盤時,點擊列表視圖項目。這被描述爲here

  2. 他們reported這是模擬器的問題。