Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

好像阻止了android 的back键盘监听~ #12

Closed
yuanji123 opened this issue Nov 11, 2016 · 8 comments
Closed

好像阻止了android 的back键盘监听~ #12

yuanji123 opened this issue Nov 11, 2016 · 8 comments

Comments

@yuanji123
Copy link

BackAndroid.addEventListener('hardwareBackPress', this.back); 浏览大图的时候监听不了这个

@ascoders
Copy link
Owner

这个插件不会干扰监听物理键的,它只会截断作用范围内UI的手势

@yuanji123
Copy link
Author

是我的问题

@lixj0126
Copy link

是什么问题呢?我也遇到了

@aijason
Copy link

aijason commented Apr 12, 2017

什么原因?

@aijason
Copy link

aijason commented Apr 12, 2017

我的安卓点击虚拟返回键没有效果

@aijason
Copy link

aijason commented Apr 12, 2017

@yuanji123 你是怎么解决的?

@tosslee
Copy link

tosslee commented May 19, 2017

如果是跟例子一样用Modal包着ImageView,给onRequestClose传一个函数控制visible属性就行了

@fssantos
Copy link

fssantos commented Feb 4, 2019

@tosslee your solution is perfect. I'll just translate it.

如果是跟例子一样用Modal包着ImageView,给onRequestClose传一个函数控制visible属性就行了

Translation: If you're using a <Modal> just pass it onRequestClose props with your control state boolean toggle function.

Example:

//render 
       <Modal visible={this.state.isFullscreen} transparent={true}
          onRequestClose={() => { this.toggleFullscreen(false) }}>{...}</Modal>

  toggleFullscreen = (val) => {
    this.setState((prevState) => ({
      isFullscreen: val
    }))
  }

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

No branches or pull requests

6 participants