Try the code below. It works before ios7
UIView * testView = self.navigationController.navigationBar ;
CGRect frame = testView.layer.frame ;
testView.layer.anchorPoint = CGPointMake(0.5f, 0.0f) ;
testView.layer.frame = frame ;
[UIView animateWithDuration:1.0 animations:^{
CABasicAnimation *shake = [CABasicAnimation animationWithKeyPath:@"transform"];
shake.duration = 1.0;
shake.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0 ,1.0)];
shake.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 0.5, 1.0)];
shake.removedOnCompletion = NO;
shake.fillMode = kCAFillModeForwards;
[testView.layer addAnimation:shake forKey:@"shakeAnimation"];
}];