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

纠错: 第四章 4.7 对齐与相对定位(alignment) #197

Open
zhangyyysss opened this issue Jun 12, 2023 · 0 comments
Open

纠错: 第四章 4.7 对齐与相对定位(alignment) #197

zhangyyysss opened this issue Jun 12, 2023 · 0 comments

Comments

@zhangyyysss
Copy link

书中计算转换坐标:
Alignment可以通过其坐标转换公式将其坐标转为子元素的具体偏移坐标:
(Alignment.xchildWidth/2+childWidth/2, Alignment.ychildHeight/2+childHeight/2)

实际上坐标转换应该与原容器大小有关:
https://api.flutter-io.cn/flutter/widgets/Align-class.html
https://segmentfault.com/a/1190000041631644

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