2011-07-18 15 views
0

我見過很多次等待面板(面板uiactivityindicatorview)黑/黑,有一些透明度和白色標籤。 贊一個:哪個UI對象要做到這一點?

enter image description here

我想這是一個標準的元素。 我在哪裏可以找到它?

+3

只是一個具有透明背景的UIView,不是嗎? – onnoweb

+0

我前段時間在尋找可可組件的可視化指南,但似乎沒有:http://stackoverflow.com/questions/2781055/is-there-a-visual-guide-to-the-uikit -components –

回答

0

到目前爲止,在iOS中沒有標準UIElement

但結帳這個library

0

有沒有這樣做的iOS組件。

如果你不想爲這個組件包含一個外部庫,那麼你可以使用UI組件來完成。

/* Warning, typed from memory */ 

// Create the UIView that's the background 
UIView *pleaseWaitView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)]; 
[pleaseWaitView setBackgroundColor:[UIColor colorWithWhite:0.5 alpha:0.5]]; 
[[pleaseWaitView layer] setCornerRadius:5.0f]; 

// And create an activity indicator 
UIActivityIndicator *i = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; 
[i startAnimating]; 
[pleaseWaitView addSubview:i]; 
[i release]; 

// Add it to the main view (in the middle) 
[pleaseWaitView setCenter:CGPointMake(self.view.bounds.size.width/2, self.view.bounds.size.height/2)]; 
[self.view addSubview:pleaseWaitView]; 

您可以用同樣的方法添加與任何你想要的文字一個UILabel(在你的情況下,「身份驗證」),爲你添加了活動的指標。

棘手的部分是設置圓角半徑 - 你可能會需要這個在您的.m文件的頂部:

#import <QuartzCore/QuartzCore.h> 

NB你可以在Interface Builder如果你想從這樣做,以及(除);)

0

我回答了一個問題,其中包括這樣的覆蓋。我包含了你需要的代碼和覆蓋圖片。看看這個答案,並看看它創建的屏幕截圖。由於我在後臺發送電子郵件時使用了此覆蓋,所以您需要編輯代碼以執行功能,但覆蓋代碼已經就位。

Locking the Fields in MFMailComposeViewController

編碼快樂!

相關問題