在初始屏幕上添加UIActivityController

时间:2011-09-28 11:38:11

标签: iphone ios xcode

我拿了一个 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;

这就是我的全部。

2 个答案:

答案 0 :(得分:1)

无法使用UIActivityController,但您可以按照

的方式进行操作

首先,你拿

<。>文件中的

IBOutlet UIProgressView * threadProgressView;
<。>文件中的

// 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];
    }

答案 1 :(得分:1)

您可以像这样添加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];
}