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

原始指针事件处理代码测试不通过 #72

Closed
r17171709 opened this issue Jan 2, 2019 · 7 comments
Closed

原始指针事件处理代码测试不通过 #72

r17171709 opened this issue Jan 2, 2019 · 7 comments

Comments

@r17171709
Copy link

你好,我按照文章中的示例代码进行测试,好像Behavior均未实现如图文所示的效果

@wendux
Copy link
Member

wendux commented Jan 2, 2019

这块有更新,可以对照原文重试一下

@r17171709
Copy link
Author

@wendux 好像不是吧,我直接看chapter8里面的listener.md,HitTestBehavior.translucent添加之后一样不能穿透。我的flutter版本是1.0.0+1

@wendux
Copy link
Member

wendux commented Jan 3, 2019

确定代码和下图中一样(在Stack中),并且点击范围正确吗?
image

@r17171709
Copy link
Author

@wendux 你好,我测的结果是,注释掉translucent之后,点击非文本区域,控制台只会打印“down0”,点击文本区域,控制台只会打印“down1”。放开注释之后,非文本区域打印“down1”、“down0”,文本区域只会打印“down1”

@wendux
Copy link
Member

wendux commented Jan 4, 2019

对的,这样就是符合预期的,文本区域已经有内容了,所以肯定会参与事件竞争的,只要点击到文本区域,就只会有"down1"

@r17171709
Copy link
Author

@wendux 那文章的内容不就是有误了吗,应该是非文本区域没有添加translucent只会打印down0,而不是down1

@wendux
Copy link
Member

wendux commented Jan 7, 2019

已更正

@wendux wendux closed this as completed Jan 7, 2019
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