简体   繁体   English

如何设置scrollView scrollBy传感器x,y?

[英]How to set scrollView scrollBy sensor x, y?

I want, that srcollView scrolling by motion sensor y, x. 我想要srcollView通过运动传感器y,x滚动。 If I tilt my device up it scrols up, if I tilt my device down, scrollView scroll down. 如果我将设备向上倾斜,则它会向上滚动;如果我将设备向下倾斜,则scrollView向下滚动。

Is it possible? 可能吗? Sorry if my question is stupid! 对不起,如果我的问题很愚蠢!

Yes it's possible. 是的,有可能。 ScrollView has multiple methods to scroll by x and y along with z and the motion sensors tutorial shows you how to track the user tilting the device. ScrollView有多种方法可以与z一起滚动xy ,并且运动传感器教程向您展示了如何跟踪用户倾斜设备。 It's up to you though to turn the output from the accelerometer or gravity sensor into those x and y inputs to scroll by. 您可以将加速度计或重力传感器的输出转换为x和y输入以滚动显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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