views:

1079

answers:

1

Hi, I have a UIActivityIndicatorView that I create and position in loadView function.

It works fine except that I can see for a split second the UIActivityIndicatorView on the top left corner before reposition itself to the center of the screen.

Why does it do that? And how can I prevent that?

I also try creating the UIActivityIndicatorView in viewDidLoad function and the same thing happens.

BTW, I'm using UIActivityIndicatorView as an example, but I also have a UIImageView that I alpha 0 and I also see it for a split second before it goes away.

Please enlight.

Thank you, Tee

A: 

Try adding it to the view before you change its position:

[self.view addSubview:spinner];
spinner.center = self.view.center;
PfhorSlayer