React Native(三)——监听物理返回键的步骤

1.this.gobackitem=this.goback.bind(this);

2.this.BackHandlerlistener=BackHandler.addEventListener('hardwareBackPress', this.gobackitem);


3.componentWillUnmount(){

    this.BackHandlerlistener.remove();

}


4.goback(){
       Actions.newapp()
        return true;
}

猜你喜欢

转载自blog.csdn.net/Rqlinna/article/details/82738231
今日推荐