Comments (15)
你试试直接用view.getRootView()
试试呢
from happybubble.
试过了,view.getRootView() 跟注释掉这段一样的效果
from happybubble.
尝试过安装一下demo看会报错吗?
from happybubble.
没有报错,所以感觉传进去的自定义view有关系,我的是悬浮窗的自定义 view
from happybubble.
那你把这几句都注释了试试!
int[] contentLocation = new int[2];
view.getRootView().findViewById(android.R.id.content).getLocationOnScreen(contentLocation);
clickedViewLocation[0] -= contentLocation[0];
clickedViewLocation[1] -= contentLocation[1];
from happybubble.
注释掉可以,就是显示位置有点偏移
from happybubble.
因该是向下偏移了个状态栏的高度吧?
from happybubble.
跟上一个问题的显示问题差不多
from happybubble.
在这里你计算一下状态栏高度,然后减去这个高度因该就可以了
from happybubble.
clickedViewLocation[1] -= 状态栏高度
from happybubble.
好,我搞搞
from happybubble.
恩,或则通过setOffsetX
和setOffsetY
设置当前位置的偏移也许能达到更符合你的效果
from happybubble.
现在就是通过setOffsetX 和setOffsetY设置,来达到效果的
from happybubble.
恩,这里看来也得判断一下,没有考虑到悬浮窗的问题。这里的代码就是为了解决上一个问题
from happybubble.
已更新,v1.1.7已修复
from happybubble.
Related Issues (20)
- 如何给bubble添加图片背景 HOT 1
- Bubblelyout自带的padding如何去除
- 关于 bubblePadding HOT 1
- 很好用的气泡效果, 但是必须强制带箭头.. 能否可以不需要箭头? HOT 1
- 在view的正下方显示不适配。。。
- TextView自动换行了 HOT 20
- 初始化BubbleDialog,super(context)报错,java.lang.InstantiationException: java.lang.Class<com.android.internal.R$dimen> has no zero argument constructor HOT 5
- 请支持RTL布局 HOT 4
- BubbleLayout嵌套exoplayer,无法播放视频 HOT 21
- BubbleLayout高度超出手机屏幕直接不显示了 HOT 2
- App若未适配挖孔屏,会导致dialog位置偏移
- 气泡的Y轴位置有问题 HOT 1
- 1.2.5下载不了,1.2.4可以,是不是没上传 HOT 2
- 自定义 BubbleDialog的时候如何改变气泡和倒三角的颜色啊 HOT 1
- 关于箭头位置问题 HOT 3
- 箭头位置在列表中设置无效 HOT 11
- 依赖 HOT 1
- 分屏情况下的点击位置没有适配
- TextView中某个文字的坐标 HOT 2
- 怎么去除遮罩层 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from happybubble.