android - 在 ConstraintLayout 中对 Google map 进行动画处理会使应用程序卡住

标签 android google-maps android-constraintlayout

最近,我开始在我的应用程序中实现 CostraintLayout,并且我有一个基于 map 的应用程序需要 map 动画。因此,我使用强大的 ConstraintSet 对其进行动画处理,但是当我尝试删除旧约束并将新约束连接到 map 时,应用程序卡住并给出 ANR。

我的代码:

ConstraintSet set = new ConstraintSet();
set.clone(parent);

set.clear(R.id.detailView, ConstraintSet.TOP);
set.clear(R.id.map, ConstraintSet.BOTTOM);

set.connect(R.id.detailView, ConstraintSet.BOTTOM, R.id.parent, ConstraintSet.BOTTOM, 0);
set.connect(R.id.map, ConstraintSet.BOTTOM, R.id.detailView, ConstraintSet.TOP, 0);

AutoTransition trans = new AutoTransition();
trans.setDuration(500);
trans.setInterpolator(new LinearInterpolator());

TransitionManager.beginDelayedTransition(parent, trans);
set.applyTo(parent);

注意:在 Android 4.4.4 上测试

最佳答案

这是 Google map 版本 16.4.1 中修复的错误

关于android - 在 ConstraintLayout 中对 Google map 进行动画处理会使应用程序卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52162503/

相关文章:

javascript - 在谷歌地图中找到一个圆圈内的所有经纬度

android - 将 View 宽度动态设置为父布局的百分比

android - 自定义 View 不遵守约束布局中的约束

java - 添加 Google Ads 后应用程序意外关闭

java - 如何在 Android 上使用已编译的 FFMPEG jar 执行 FFMPEG

android - 如何使 ionic 应用程序从应用程序本地的 .json 文件中读取 json 数据

android - 自定义 myLocation Google map v2 Android 的标记

php - 使用 PHP 和 MYSQL 的 Google map

android - 使用 Intent.createChooser 使用 Waze 和谷歌地图导航显示 Waze 图标两次

android - 如何在xml中的框架布局中嵌套约束布局?