开发者

Display an image for a few seconds

I want to be able to display an image on the iPhone when the dev开发者_StackOverflowice is shaken. I can play a sound but also want to pop up an image at the same time.

Any ideas on how to do this would be appreciated.

thx, wes


How I would do it?

  1. In your header file, define an UIImageView.
  2. When your device is shaken, init the view with the right frame
  3. Load an image in that UIImageView.
  4. Add that UIImageView to the view that is currently shown.
  5. Create a NSTimer which has an interval of the time you want to show your image
  6. When the timer hits its interval, remove the imageview from the view.

I am not putting all kinds of code here, because you also supply no code whatsoever, but I think you can figure it out yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜