【发布时间】:2015-01-22 02:25:28
【问题描述】:
你好,我想按纬度和经度旋转图像视图,假设我有
lat/LNG: (33.6343541968021,73.06278146803379)
现在我想让我的图像视图(针)指向这个位置,我该怎么做? 我正在这样做
public void onSensorChanged(SensorEvent event) {
float degree = Math.round(event.values[0]);
RotateAnimation ra1 = new RotateAnimation(
currentDegree,
-degree,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF,
0.5f);
// how long the animation will take place
ra1.setDuration(0);
// set the animation after the end of the reservation status
ra1.setFillAfter(true);
compass_img.startAnimation(ra1);
currentDegree= -degree;}
我正在使用方向传感器
【问题讨论】:
标签: android latitude-longitude android-orientation image-rotation compass-geolocation