seemefly163_0 发表于 2013-1-14 21:14:56

iOS摇一摇的实现

把下边的代* 放到UIVIEWCONTROLLER里,就能实现摇一摇效果
 

- (BOOL) canBecomeFirstResponder{    return YES;}- (void) viewDidAppear:(BOOL)animated{    ;    ;}- (void) viewWillAppear:(BOOL)animated{    ;    ;}- (void) motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{    if (motion == UIEventSubtypeMotionShake) {      NSLog(@"Shake..........");    }} 
页: [1]
查看完整版本: iOS摇一摇的实现