从android中的气球中删除覆盖窗口

发布于 2024-12-19 03:13:43 字数 128 浏览 4 评论 0原文

我想在单击地图视图后隐藏叠加项目窗口弹出窗口。目前,当我单击气球时,会弹出窗口。如果我点击其他气球,则先前的气球弹出窗口会隐藏,并且新的弹出窗口会出现在该气球上。这是正确的。但我有一个问题来隐藏地图视图点击/触摸上的弹出窗口。请分享解决方案。

I want to hide the overlay item window popup after click on the mapview. Currently when i click on the balloon then popup window comes. if i tap on other ballon then previous ballon pop up window hide and new pop up window comes on that ballon. this is correct. But I have a problem to hide that pop up on the mapview click/Touch. Please share the solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩起发的微风 2024-12-26 03:13:43

要解决这个问题,首先您必须在 MapActivity 中获取静态变量。

例如 public static isMapRefreshed = false;

然后转到 BalloonItemizedOverlay 类,那里有一个绘制方法。
在那里编写以下代码来解决这个问题。

私人 BalloonOverlayView 气球视图;

如果(UsersNearMe.isMapRefreshed){
隐藏气球();
}

私人无效 hideBalloon() {
if (balloonView!= null) {
bubbleView.setVisibility(View.GONE);
}
在 MapView ClickListener 上,

将 isMapRefreshed 的静态值更改为 true。然后点击将 isMapRefreshed 的静态值更改为 false

To resolve this firstly you have to take static variable in the MapActivity.

e.g public static isMapRefreshed = false;

Then goto BalloonItemizedOverlay class there is a draw method there.
write following code there to resolve this.

private BalloonOverlayView balloonView;

if(UsersNearMe.isMapRefreshed){
hideBalloon();
}

private void hideBalloon() {
if (balloonView != null) {
balloonView.setVisibility(View.GONE);
}
}

on mapview clicklistener change the static value for the isMapRefreshed to true. and on tap change the static value for the isMapRefreshed to false

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文