gpt4 book ai didi

ios - 事件指示器不动画 IOS

转载 作者:行者123 更新时间:2023-11-28 20:35:17 25 4
gpt4 key购买 nike

事件指示器在我的代码中没有动画。我有以下代码

我该如何解决?是因为平均线程不更新指示器状态吗?如果是这样,我该如何解决?

@interface ConnectionEstablishedViewController : UIViewController{
IBOutlet UIActivityIndicatorView * activityView;
IBOutlet UILabel *loadingLabel;
}
@property(nonatomic,retain) UIActivityIndicatorView * activityView;

我已经在 my.xib 文件中分配了标签和事件指示符

.m

- (void) threadStartAnimating {
[activityView startAnimating];
loadingLabel.hidden=YES;
}
- (void) threadStopAnimating {
[activityView startAnimating];
loadingLabel.hidden=NO;
}


-(void)viewDidAppear:(BOOL)animated{


[self threadStartAnimating];
[NSThread sleepForTimeInterval:3.0];
[self hunttable];//call hunttable in order to fetch hunt table data

[NSThread sleepForTimeInterval:3.0];//sleep to prevent thread from overlap

[self huntingarea];
[NSThread sleepForTimeInterval:3.0];

[self stands];
[NSThread sleepForTimeInterval:3.0];

[self weapons];
[NSThread sleepForTimeInterval:3.0];

[self backpack];
[NSThread sleepForTimeInterval:3.0];

[self descriptionget];
[NSThread sleepForTimeInterval:3.0];

[self threadStopAnimating];


}

最佳答案

我遇到了类似的问题

- (void)viewDidLoad
{
[super viewDidLoad];
[self threadStartAnimating];
}
-(void)viewDidAppear:(BOOL)animated{
.
...//functions
[self threadStopAnimating];


}

以上应该可行

关于ios - 事件指示器不动画 IOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10769957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com