Je rencontre un problème avec mon UITextFields dans mon application iPhone et j'espère que quelqu'un l'aura déjà vu auparavant.Problème d'édition UITextField - SDK iPhone
J'ai quelques UITextField sur mon écran, et quand ils sont tapés et leur clavier apparaît ils sont couverts. Pour surmonter ce problème, j'ai animé en vue de se déplacer avec:
-(void)moveViewUpFromValue:(float)fromOldValue toNewValue:(float)toNewValue keep:(BOOL)keep {
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
theAnimation.duration=0.25;
theAnimation.repeatCount=1;
if(keep) {
[theAnimation setRemovedOnCompletion:NO];
[theAnimation setFillMode:kCAFillModeForwards];
}
theAnimation.fromValue=[NSNumber numberWithFloat:fromOldValue];
theAnimation.toValue=[NSNumber numberWithFloat:toNewValue];
[self.view.layer addAnimation:theAnimation forKey:@"animateLayer"];
}
Ceci, visuellement, fonctionne très bien, cependant, quand je vais à modifier (maintenir l'écran vers le bas pour obtenir la loupe), il ne apparaître. L'interaction est conservée dans la position avant qu'elle ne bouge.
Des idées sur ce qui pourrait se passer ici?
Un grand merci, Brett
C'était tout. Merci beaucoup! Après avoir regardé un peu plus, je suis d'accord que [UIView beginAnimations ...] est probablement la meilleure façon de le faire. – Brett