2011-05-31 75 views
1

我有一個MBProgressHUD,顯示在UISplitViewApplication的detailViewController中。當你從任何一個方向開始時,它最初的工作都很好。但是,一旦我將風景的方向從縱向改變爲縱向,反之亦然,視圖變得非常混亂。我做的代碼是:UISplitViewController中的MBProgressHUD

HUD = [[MBProgressHUD alloc] initWithView:self.view]; 
    [self.view addSubview:HUD]; 

這是在viewDidLoad中定義的。 有沒有人成功解決了這個定位問題?

回答

0

我能夠釋放分配HUD解決這一時的方向變化。我的問題是分離視圖控制器中HUD的佈局不正確。切換視圖時,黑色背景和指示燈會分離。所以這就是我解決問題的方法。

+0

新(er)版本的MBProgressHUD應該可以在任何方向上正常工作。 – 2012-04-10 15:37:58

1

MBProgressHUD只是沒有改變方向時顯示。

你可以用我的叉子SVProgressHUD來處理它只是你想要的。

0

當我改變方向時,Im對MBProgressHUD沒有任何問題,這是我如何使用它。

HUD = [[MBProgressHUD alloc] initWithView:self.view]; 
    [self.view addSubview:HUD]; 
    HUD.labelText = @"Please wait.."; 
    HUD.detailsLabelText = @"Getting data"; 
    [HUD showWhileExecuting:@selector(thefunction) onTarget:self withObject:nil animated:YES]; 
+0

這就是我使用它的方式 – adit 2011-05-31 16:23:56

3

確保您使用的是最新版本(V0.4),然後使用以下命令:

// Should be initialized with the windows frame so the HUD disables all user input by covering the entire screen 
HUD = [[MBProgressHUD alloc] initWithWindow:[UIApplication sharedApplication].keyWindow 

// Add HUD to screen 
[self.view.window addSubview:HUD];