Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有Activity一个透明的(底部-> 向上)SlidingDrawer。当我向上滚动屏幕时,我只想获取其可见区域的宽度和高度。可能吗?我想我可以使用任何getLocalVisibleRect()andgetGlobalVisibleRect()方法来实现,但我错了,因为它们返回了布局矩形。
Activity
SlidingDrawer
getLocalVisibleRect()
getGlobalVisibleRect()
做好了!SlidingDrawer获取其手柄在屏幕上的(X,Y)坐标,可以测量可视区域。
mySlidingDrawer.getHandle().getY(); mySlidingDrawer.getHandle().getX();