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

问一下,怎么动态更新位置? #82

Closed
csh159 opened this issue Mar 14, 2023 · 6 comments
Closed

问一下,怎么动态更新位置? #82

csh159 opened this issue Mar 14, 2023 · 6 comments
Labels
TODO New feature or request

Comments

@csh159
Copy link

csh159 commented Mar 14, 2023

比如在某些页面距底部30dp,但是有些页面不需要间距?

@csh159
Copy link
Author

csh159 commented Mar 14, 2023

设置setGravity(FxGravity.RIGHT_OR_BOTTOM),代码调用setBorderMargin(0,0,200,0)无效,会跑到屏幕上面去

@Petterpx
Copy link
Owner

设置setGravity(FxGravity.RIGHT_OR_BOTTOM),代码调用setBorderMargin(0,0,200,0)无效,会跑到屏幕上面去

setBorderMargin() 方法是用于设置移动位置的边框,比如setBorderMargin(0,0,200,0),相当于浮窗可移动位置距离屏幕底部会有200px的偏移量。动态更新位置的话,这个的确之前没考虑过,这边可以增加一个api去处理。

@Petterpx Petterpx added the TODO New feature or request label Mar 14, 2023
@Petterpx
Copy link
Owner

Petterpx commented Apr 2, 2023

比如在某些页面距底部30dp,但是有些页面不需要间距?

新版本1.2.4已增加新的api,moveLocation() 与 moveLocationByVector(),使用示例如图:
image

@Petterpx Petterpx closed this as completed Apr 2, 2023
@Petterpx Petterpx pinned this issue Jun 12, 2023
@appdev
Copy link

appdev commented Jan 22, 2024

move 有时候不生效

@appdev
Copy link

appdev commented Jan 22, 2024

move 有时候不生效

这个是因为先设置了setGravity的原因,但是会出现传相同的坐标,悬浮窗还在移动的问题,比如 show的时候传坐标 150,200。后面连续传100,100 会出现在 [150,200] [100,100]来回移动的问题

@Petterpx
Copy link
Owner

move 有时候不生效

这个是因为先设置了setGravity的原因,但是会出现传相同的坐标,悬浮窗还在移动的问题,比如 show的时候传坐标 150,200。后面连续传100,100 会出现在 [150,200] [100,100]来回移动的问题

后续会处理,正在移动时会屏蔽后续的移动坐标。

@Petterpx Petterpx unpinned this issue May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants