gpt4 book ai didi

ios - iOS KeyBoard 出现时 View Transition 结结巴巴

转载 作者:行者123 更新时间:2023-11-29 03:07:20 24 4
gpt4 key购买 nike

这是我从 ViewA 显示 ViewB 的转换代码

CGPoint c = thepoint;
CGFloat tx = c.x - floorf(theview.center.x) + 10;
CGFloat ty = c.y - floorf(theview.center.y) + 100;

[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
// Transforms
CGAffineTransform t = CGAffineTransformMakeTranslation(tx, ty);
t = CGAffineTransformScale(t, 0.1, 0.1);
theview.transform = t;
theview.layer.masksToBounds = YES;
[theview setTransform:CGAffineTransformIdentity];

}
completion:^(BOOL finished) {

}];

现在过渡非常顺利,没有任何问题。

在我的 ViewB 中,我有一个带有默认焦点的文本框。 (在 viewDidAppear 中)

-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:NO];
[self performSelector:@selector(focusCommentText) withObject:nil afterDelay:0.5];
}

- (void) focusCommentText {
[self focusTextbox:commentText];
}

- (void) focusTextbox : (UITextView *) textView{
@try {
[ textView becomeFirstResponder];
}
@catch (NSException *exception) {

}
}

过渡和键盘出现..同时发生..现在有点尴尬。有人可以帮我解决这个问题吗?

最佳答案

我会做的是调用[textView becomeFirstResponder],直到转换完成

关于ios - iOS KeyBoard 出现时 View Transition 结结巴巴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22619809/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com