...
|
...
|
@@ -23,7 +23,7 @@ export default class IndexListView extends React.Component { |
|
|
|
|
|
onTouchMove(e) {
|
|
|
let {dataSource} = this.props;
|
|
|
let Y = e.nativeEvent.pageY - Math.ceil((viewHeight - dataSource.length * (itemHeight+2))/2);
|
|
|
let Y = e.nativeEvent.pageY - Math.ceil((viewHeight - dataSource.length * (itemHeight+2))/2) - 8;
|
|
|
var index = Math.ceil(Y/(itemHeight+2))-1;
|
|
|
let sectionID = dataSource[index]
|
|
|
this.props.onLetterPress && this.props.onLetterPress(index,sectionID);
|
...
|
...
|
@@ -36,6 +36,8 @@ export default class IndexListView extends React.Component { |
|
|
return null;
|
|
|
}
|
|
|
let keyData = [];
|
|
|
|
|
|
keyData.push(<Image style={styles.image} source={require('../../images/search.png')}/>);
|
|
|
for (var i = 0; i < dataSource.length; i++) {
|
|
|
let name = dataSource[i];
|
|
|
if (name == '0-9') {
|
...
|
...
|
@@ -62,7 +64,7 @@ let styles = StyleSheet.create({ |
|
|
width: 10,
|
|
|
height: viewHeight,
|
|
|
bottom : 1,
|
|
|
right: 1,
|
|
|
right: 2,
|
|
|
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
|
justifyContent: 'center',
|
|
|
},
|
...
|
...
|
@@ -71,8 +73,11 @@ let styles = StyleSheet.create({ |
|
|
textAlign: 'center',
|
|
|
fontSize: 10,
|
|
|
color: 'black',
|
|
|
fontWeight: 'bold',
|
|
|
backgroundColor: 'transparent',
|
|
|
marginTop: 2,
|
|
|
}
|
|
|
},
|
|
|
image: {
|
|
|
width: 8,
|
|
|
height: 8,
|
|
|
},
|
|
|
}); |
...
|
...
|
|