开发者

MotionEnded is not called continuously

开发者 https://www.devze.com 2023-03-15 16:36 出处:网络
There is a list of videos in main view. In that main view, i have added a UIWebView as subview to play videos.

There is a list of videos in main view. In that main view, i have added a UIWebView as subview to play videos.

I suppose to do, when i shake iPhone it should play the next video in UIWebView.

It is working fine for the very first time but as come back to main view and again try to perform the same th开发者_C百科ing, it is not reacting.

Any solution please?


Make sure when the view (re)appears that you set it as the first responder.

-(void)viewDidAppear:(BOOL)animated
{
 [self becomeFirstResponder];
}

It needs to be in viewDidAppear and not viewWillAppear

0

精彩评论

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