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

【DoKit&北大开源实践】-【DoKit For IOS】- 相对位置插件 #828

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Cheney-QIAN
Copy link

相对位置插件:

在开发过程中,或进行UI后期走查的时候,可能需要确定不同插件的位置、检查其是否对齐、相对大小是否合适等,这时候就可以用到相对位置插件。

使用指南

第一步:选择Dokit面板中的相对位置插件选项

第二步:点击相对位置插件后屏幕中心会出现两个红芯圆,移动两个红芯圆到两个元素上,会在屏幕下方的窗口中显示两个控件的四个方向的边距、相对面积、各自相对于屏幕的位置;点击窗口右边的关闭按钮,即可取消相对位置确认工作。

项目代码

项目代码地址

/DoraemonKitmaster/iOS/DoraemonKitDemo/DoraemonKitDemo/Plugin

主要涉及模块有:

RelativePositionPlugin

RelativePostionManager

RelativePositionView

RelativePostionManager持有两个RelativePositionView:viewCheckViewA和

viewCheckViewB。RelativePositionView中有移动检测函数[M]touchesBegan、[M]touchesMoved、[M]touchesCancelled、[M]touchesEnded。在[M]touchesBegan、[M]touchesMoved中一旦发现needRefresh,则会调用[RelativePositionManager.shareInstance refresh]更新屏幕下方infoWindow中的信息。

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

Successfully merging this pull request may close these issues.

1 participant