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

点击图片事件如何回调 #24

Closed
ChirsJoe opened this issue Jun 5, 2019 · 1 comment
Closed

点击图片事件如何回调 #24

ChirsJoe opened this issue Jun 5, 2019 · 1 comment

Comments

@ChirsJoe
Copy link

ChirsJoe commented Jun 5, 2019

想做预览图片,点击图片如何回调到当前的ViewController中呢?

@dequan1331
Copy link
Owner

如果使用了HybridPageKit中的webComponentDomClass及webComponentIndexKey来替换全部的web标签为Native的话,点击图片的事件直接加到ImageView上即可。可以设置对应的特殊ImageView类,或者在HPKControllerProtocol中的willAppear中直接添加,在willDisappear中移除。
如果没有使用,希望是在标签中响应,就需要书写JS代码并且和Native进行通信了,可以使用WKWebView自带的或开源第三方框架进行通信。JS获取图片信息以及位置,传递给Native做动画和展示。

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