0

I got a view with a uitableview. I am adding a subview to this by using this code:

.h
IBOutlet UIView *colorView;
@property (nonatomic, retain) UIView *colorView;


.m in viewDidLoad
[self.view addSubview:colorView];

The problem is that my subview is acting really slow. When click in a UITextField in my subview, the cursor sort of slide slowly in for the top left corner and when you type the cursor moves slowly too.

Hope someone can help me

Thanks in advance :)

Update: I figured out that it all happens when I'm adding the subview.

Update 2: I have localized the problem to be when I present the subview. I have made so that when you click at a certain tableviewcell the colorView is displayed by this code:

  [UIView beginAnimations:@"SlideInFromTop" context:nil];
  [UIView setAnimationDuration:0.35];
  [UIView setAnimationDelegate:self];
  [UIView setAnimationRepeatCount:0];
  [UIView setAnimationRepeatAutoreverses:NO];

After this code is executed my app begins to work very slow, especially when I'm typing in a UITextField.

4

1 回答 1

0

我解决了!问题是我忘了提交动画:

[UIView commitAnimations];
于 2012-12-18T19:37:54.853 回答