Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为何我定位的字母是显示在屏幕中间,而不是页面顶部? #46

Open
lhhhhhhhhh opened this issue Jan 15, 2018 · 2 comments

Comments

@lhhhhhhhhh
Copy link

import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
TouchableOpacity,
Animated,
TouchableHighlight,
ScrollView,
DeviceEventEmitter
} from 'react-native';
import AlphabetListView from 'react-native-alphabetlistview';

export default class TestMailListScreen extends Component<{}> {
constructor(props) {
super(props);
this.state = {
data: {
A: ['some','entries','are here','are here','are here','are here','are here','are here','are here','are here','are here','are here','are here','are here'],
B: ['some','entries','are here'],
C: ['some','entries','are here','are here','are here','are here','are here','are here','are here','are here','are here','are here','are here','are here'],
D: ['some','entries','are here'],
E: ['some','entries','are here'],
F: ['some','entries','are here'],
G: ['some','entries','are here'],
H: ['some','entries','are here'],
I: ['some','entries','are here'],
J: ['some','entries','are here'],
K: ['some','entries','are here'],
L: ['some','entries','are here'],
M: ['some','entries','are here'],
N: ['some','entries','are here'],
O: ['some','entries','are here'],
P: ['some','entries','are here'],
Q: ['some','entries','are here'],
R: ['some','entries','are here'],
S: ['some','entries','are here'],
T: ['some','entries','are here'],
U: ['some','entries','are here'],
V: ['some','entries','are here'],
W: ['some','entries','are here'],
X: ['some','entries','are here'],
Y: ['some','entries','are here'],
Z: ['some','entries','are here'],
}
};
}

render(){
    return(
        <AlphabetListView
            data={this.state.data}
            cell={this.Cell.bind(this)}
            cellHeight={30}
            sectionListItem={this.SectionItem.bind(this)}
            sectionHeader={this.SectionHeader.bind(this)}
            sectionHeaderHeight={22.5}
            updateScrollState={true}
        />
    )
}
Cell(data){
    return (
        <View style={{height:30}}>
          <Text>{data.item}</Text>
        </View>
    );
}
SectionItem(data){
    return (
        <View>
            <Text style={{color:'#f00'}}>{data.title}</Text>
        </View>
    );
}
SectionHeader(data){
    return (
        <View style={{backgroundColor: '#ccc'}}>
          <Text style={styles.textStyle}>{data.title}</Text>
        </View>
    );
}

}
const styles = StyleSheet.create({
textStyle: {
textAlign:'center',
color:'#fff',
fontWeight:'700',
fontSize:16
},
});
页面初始化 内容所有字母没有一次性加载出来,而是页面滑倒底部才慢慢加载,这样导致数据没加全,点击右侧字母定位不准确。请问如何处理?

@lhhhhhhhhh
Copy link
Author

lhhhhhhhhh commented Jan 16, 2018

您好,我刚发现的新问题,我点击的是G 但是源码中scrollToSection(section)输出的section是E,请问如何解决这个问题?

@hejiaji
Copy link

hejiaji commented Feb 28, 2018

@lhhhhhhhhh 作者表示已经不维护这个库了. (另:你写中文作者哪看的懂啊?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants