11/09/13 12:53:41.57
>>239
で、多分こんな感じかな。200 のところは画像サイズに合わせて変更して。
あと、このメソッドは親クラスのメソッドをオーバーライドしてないから、@Override は不要。
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) {
int x = (int) (event.values[0] * 200 / 360);
HorizontalScrollView hsv = (HorizontalScrollView) findViewById(R.id.ScrollView);
hsv.scrollTo(x, 0);
}
}