Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户摇动 iphone 时,我想在我的应用程序中触发一个方法(显示警报)。即使用户不使用该应用程序,这也应该有效。我该怎么做?
如果您的应用程序没有在前台运行,您将无法访问加速度计。你不能做你打算用iOS做的事情,至少除非你越狱否则不能。