سؤال

أنا أكتب تطبيق iPad يحتوي على UIWEBView ومؤشر نشاط عندما يتم تحميل الصفحات في WebView. أعتقد أن هذا سؤال غبي ولكن كيف يمكنني التأكد من أن مؤشر النشاط يتركز في جميع الأوقات؟ إذا كان لديّ رأسيًا ، فسيتمحوره ، ولكن إذا قمت بإدارة iPad أفقياً ، فإن مؤشر النشاط أصبح الآن في مكان ما في الربع الأيسر السفلي بدلاً من المركز.

شكرا مقدما!

هل كانت مفيدة؟

المحلول

UIActivityIndicatorView *progress_ind = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
progress_ind.center = CGPointMake (self.view.bounds.size.width * 0.5F, self.view.bounds.size.height * 0.5F);
[progress_ind startAnimating];
progress_ind.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);

[self.view addSubview:progress_ind];
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top