我想在從url下載文件時顯示微調。它下載文件但不顯示微調。標籤也不在中心。 我怎樣才能讓它居中。微調(UIActivityIndicator)不在iOS中顯示
我已經嘗試使用self.view.center,但不起作用。
代碼
container = [[UIView alloc] init];
//container.center = self.view.center;
activityLabel = [[UILabel alloc] init];
activityLabel.text = NSLocalizedString(message, @"string1");
activityLabel.textColor = [UIColor darkGrayColor];
activityLabel.font = [UIFont boldSystemFontOfSize:8];
[container addSubview:activityLabel];
activityLabel.frame = CGRectMake(30, 55, 225, 50);
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[container addSubview:activityIndicator];
activityIndicator.frame = CGRectMake(30, 55, 225, 50);
[self.view addSubview:container];
container.center = CGPointMake(container.frame.size.width/2, container.frame.size.height/2);
self.view.backgroundColor = [UIColor whiteColor];
[activityIndicator startAnimating];
請把一些光在它....
那是你的viewDidLoad方法? – JSA986