简体   繁体   中英

Google Maps Android API v2 animate GoogleMap View

I am trying to animate that wraps the Google Maps Fragment in my layout. The following animation appears to have no effect.

ObjectAnimator mapAnimator = ObjectAnimator.ofFloat(view, "translationY", -view.getHeight(), view.getHeight());

I have tried wrapping the fragment in FrameLayout and animating that with no luck. I can only seem to hide and show the map with the FragmentManager.

According to this issue the Google Map uses a SurfaceView which can't be animated. I cannot find anything official to support this. Can anyone confirm?

I cannot find anything official to support this.

If "this" means the fact that Maps V2 uses SurfaceView , drop a ViewServer in your app , hook up Hierarchy View to your app running on a Maps V2-capable device, and see what you see. Cyril Mottier wrote comment #1 on the issue you cited; since he says it is a SurfaceView , I believe him.

If "this" means the fact that SurfaceView cannot be animated, that is confirmed by reading the documentation for TextureView .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM