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

请问一下pullrelease状态不显示是什么问题 #32

Open
yourenA opened this issue Apr 20, 2017 · 0 comments
Open

请问一下pullrelease状态不显示是什么问题 #32

yourenA opened this issue Apr 20, 2017 · 0 comments

Comments

@yourenA
Copy link

yourenA commented Apr 20, 2017

版本:"react-native-pull": "latest",
`
async onPullRelease(resolve){
let that=this;
await that.getWeather(that.state.localCity);
console.log('刷新');
resolve();
}

topIndicatorRender=(pulling, pullok, pullrelease)=> {
    const hide = {position: 'absolute', left: 10000};
    const show = {position: 'relative', left: 0};
    setTimeout(() => {
        if (pulling) {
            this.txtPulling && this.txtPulling.setNativeProps({style: show});
            this.txtPullok && this.txtPullok.setNativeProps({style: hide});
            this.txtPullrelease && this.txtPullrelease.setNativeProps({style: hide});
        } else if (pullok) {
            this.txtPulling && this.txtPulling.setNativeProps({style: hide});
            this.txtPullok && this.txtPullok.setNativeProps({style: show});
            this.txtPullrelease && this.txtPullrelease.setNativeProps({style: hide});
        } else if (pullrelease) {
            this.txtPulling && this.txtPulling.setNativeProps({style: hide});
            this.txtPullok && this.txtPullok.setNativeProps({style: hide});
            this.txtPullrelease && this.txtPullrelease.setNativeProps({style: show});
        }
    }, 1);
    return (
        <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center', height: 60}}>
            <ActivityIndicator size="small" color="white" />
            <Text style={{color:'white'}} ref={(c) => {this.txtPulling = c;}}>下拉刷新</Text>
            <Text style={{color:'white'}} ref={(c) => {this.txtPullok = c;}}>松开刷新</Text>
            <Text style={{color:'white'}} ref={(c) => {this.txtPullrelease = c;}}>刷新中</Text>
        </View>
    );
}

<PullView style={{width: Dimensions.get('window').width}} onPullRelease={this.onPullRelease}
topIndicatorRender={this.topIndicatorRender} topIndicatorHeight={60}>
`
下拉的时候显示“下拉刷新”,
下拉到一定高度的时候显示“松开刷新”
可是松开的时候没有显示“刷新中”,而是直接隐藏刷新条
onPullRelease里的getWeather是请求
请问一下哪里出问题了?

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

1 participant