如何旋转图形页面? [英] How to rotate MapView?

查看:138
本文介绍了如何旋转图形页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是为Android一个新的开发。试图在打圈旋转图形页面。 但我不知道如何开始。

I am a new developer for Android. Tried to rotate MapView in circular motion. But I don't know how to begin.

你有一个简单的code旋转图形页面

Do you have a simple code to rotate the MapView?

推荐答案

我在过去做到了这一点,它需要创建一个自定义的ViewGroup旋转画布在dispatchDraw()方法。您还需要增加的MapView的大小(使其旋转时吸引足够的像素。)你还需要在dispatchTouchEvent旋转触摸事件()。或者,如果你使用的Andr​​oid 3.0,你可以简单地调用theMapView.rotate())

I have done this in the past and it requires to create a custom ViewGroup that rotates the Canvas in the dispatchDraw() method. You also need to increase the size of the MapView (so that it draws enough pixels when rotated.) You will also need to rotate the touch events in dispatchTouchEvent(). Or if you use Android 3.0 you can simply call theMapView.rotate() :)

这篇关于如何旋转图形页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆