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

adjust tooltip position when Tooltip.TOP #16

Open
david-serrano opened this issue Sep 26, 2018 · 4 comments
Open

adjust tooltip position when Tooltip.TOP #16

david-serrano opened this issue Sep 26, 2018 · 4 comments

Comments

@david-serrano
Copy link

david-serrano commented Sep 26, 2018

Hi there,

Whenever i use the Tooltip.TOP attribute for positioning a tooltip above the view, there is always quite a bit of space underneath it. However when using Tooltip.BOTTOM, there is no space between the view and the tooltip. Is there a way to adjust the positioning?

I tried adjusting the margins of the Tooltip Viewgroup by getting a Tooltip instance from show() to move it up and down from it's initial position but to no avail.

Screenshot attached for more info.
screen shot 2018-09-26 at 15 42 43

@jayrambhia
Copy link
Owner

jayrambhia commented Sep 27, 2018

Hi,

Thanks for reporting the issue. I'll look into it and get back to you.

Would it be possible for you to post the code snippet related to the tooltip usage?

@jayrambhia
Copy link
Owner

jayrambhia commented Sep 27, 2018

Top Bottom
screenshot_1538051944 screenshot_1538051948

@david-serrano As you can see, the demo seems to work correctly. Maybe there's some padding around your buttons? Try checking with show layout bounds option.

@david-serrano
Copy link
Author

Hi Jayrambhia, i solved the issue by forking your repository and modifying line 301 in the Tooltip class to be top -= (h + (showTip ? tip.getHeight() : 0)); essentially removing that padding value. I have checked and my layout does not have any padding, the asset used also does not have any transparent spacing.

@david-serrano
Copy link
Author

david-serrano commented Sep 27, 2018

My suggestion would be to add the padding variable as a user definable value. I will try and do this when i find some time and open a pull request :)
Edit: Just saw padding actually references the builder value - perhaps it would be useful to split that one value into 4 sections for left, right, top and bottom?

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