1. 程式人生 > >reactnative 解決listview無法滾動的問題

reactnative 解決listview無法滾動的問題

單獨的demo,沒有其它的控制元件可以正常滾動,但是發現整合到必入stack navigator中時,就怎麼也無法滾動了,最後查詢的原因是必須要擠上touchable view才可以。

_renderRow(rowData, sectionID, rowId) {
  return (
     <TouchableOpacity style = {{backgroundColor: 'rgba(0, 0, 0, 0)', width: rowWidth, height: rowHeight, justifyContent: 'flex-start', alignItems:'flex-start', position:'relative', left:0,
right:0, flex: 1}} activeOpacity={1.0}>
<Text style={{color: 'rgba(124, 140, 154, 1)', fontSize: 20, position: 'relative',width: rowWidth - rowHeight * 2 - 42, left: rowHeight + 42, top: rowHeight / 2 - 10, textAlign: 'left', backgroundColor: 'rgba(0, 0, 0, 0)'}}>
{rowData + ' ' + rowId}
</Text>
<Image source= {{uri:'scada_imageSvg'}}
style = {{backgroundColor: 'rgba(0, 0, 0, 0)', position: 'relative', left: 5, top: - 20, width: rowHeight, height: rowHeight}}/>
 </TouchableOpacity

>
    );
}