开发者

Objective C - UIActivityIndicatorView positioning

开发者 https://www.devze.com 2022-12-13 16:36 出处:网络
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 repo

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 开发者_Go百科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


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

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

精彩评论

暂无评论...
验证码 换一张
取 消