android - Skobbler Android 无法为自定义 SKAnnotationView 设置动画

标签 android animation skmaps

如何为具有自定义 View 的 SKAnnotationView 制作动画。我已经正确地给它充气,它正确地显示为:

    SKAnnotation annotationFromView = new SKAnnotation(11);
    annotationFromView.setLocation(new SKCoordinate(-122.423573, 37.761349));
    annotationFromView.setMininumZoomLevel(5);
    SKAnnotationView annotationView = new SKAnnotationView();
    customView =
            (RelativeLayout) ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(
                    R.layout.layout_custom_view, null, false);
    //  If width and height of the view  are not power of 2 the actual size of the image will be the next power of 2 of max(width,height).
    annotationView.setView(customView);
    annotationFromView.setAnnotationView(annotationView);
    mapView.addAnnotation(annotationFromView, SKAnimationSettings.ANIMATION_NONE);

单击时,我想让它不可见。我得到了适当的 RelativeLayout 并且它是正确的实例,但是它不会改变动画状态。为什么实例是正确的而不是 null 但动画 alpha 更改没有执行?

    @Override
    public void onAnnotationSelected(final SKAnnotation annotation) {
        RelativeLayout layout = (RelativeLayout)annotation.getAnnotationView().getView();
                layout.setAlpha(0);
                break;

    }

最佳答案

  1. 您正在 mapView.addAnnotation 方法上使用 SKAnimationSettings.ANIMATION_NONE,这将禁用放置动画。

  2. SKAnnotationView 不是实时 View 。如果不更新注释 View ,则无法编辑或更改它们。

关于android - Skobbler Android 无法为自定义 SKAnnotationView 设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36539471/

相关文章:

jquery - 如何使用 jQuery 为背景位置设置动画?

ios - 离线下载国家 SKMaps map 包

android - Skobbler/Scout是否支持带航点的路线、多条不同颜色的路线和 map 图例

ios - 以编程方式呈现新的 ViewController [Swift 3]

android - 如何定义显示 SKMapCustomPOI 的最小/最大缩放级别?

android - getPreferences() 对 getSharedPreferences() 使用的类名的引用

android - 用于 channel 列表的 YouTube Api

Android - 使用 TabLayout 的不同菜单项

java - 滚动自定义组件时出现 GC 滞后应用程序

javascript - 手动设置 pan.x 和 pan.y 时对 svg pan 进行动画处理