我取了一个default.png文件作为我的启动屏幕,并让它睡了几秒钟以使它可见。
但是我也想给它添加一个UIActivityController。因为我没有服用任何ViewController。
我该怎么加呢?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
_homeViewController = [[XTHomeViewController alloc]initWithNibName:kHOME_VIEW bundle:nil];
_navigate = [[UINavigationController alloc]initWithRootViewController:_homeViewController];
[self.window addSubview:_navigate.view];
[self.window makeKeyAndVisible];
[NSThread sleepForTimeInterval:0.75];
return YES;这就是我的全部。
发布于 2011-09-28 14:48:06
您可以添加这样的Activityindicater
in DemoappeDelegate.h file
IBOutlet UiView *splashView;
in DemoappDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIActivityIndicatorView *spinningWheel = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(145.0, 290.0, 25.0, 25.0)];
[spinningWheel startAnimating];
spinningWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
[splashView addSubview:spinningWheel];
[spinningWheel release];
}发布于 2011-09-28 11:48:07
没有使用UIActivityController的方法,但您可以按照以下方式来做
首先,你要
在.h文件中
IBOutlet UIProgressView * threadProgressView;在.m文件中
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
threadProgressView.progress = 0.0;
[self performSelectorOnMainThread:@selector(makeMyProgressBarMoving) withObject:nil waitUntilDone:NO];
[super viewDidLoad];
}
//For progress bar
- (void)makeMyProgressBarMoving {
float actual = [threadProgressView progress];
if (actual < 1) {
threadProgressView.progress = actual + 0.02;
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:NO];
}https://stackoverflow.com/questions/7582641
复制相似问题