2009-08-28 89 views

回答

1

我建議你使用一個UIViewController,並顯示有模式。

創建UIViewController並使用Interface Builder中的OK按鈕設置視圖,就像您使用任何視圖控制器一樣。

而且使用它顯示:

- (void)presentModalViewController:(UIViewController *)modalViewController 
          animated:(BOOL)animated 

您可以設置根觀點背景清楚,如果你希望它是透明的。當轉換完成時,optionaly將其設置爲cemi-transparent黑色。像這樣的東西會工作:

- (void)viewDidAppear:(BOOL)animated { 
    if (animated) [UIView beginAnimations:@"fadeDark" context:NULL]; 
    self.view.backgroundColor = [UIColor colorWithWithe:0.0f alpha:0.5f]; 
    if (animated) [UIView commitAnimations]; 
} 
+0

其實有一個與關於明確模態視圖控制器這種方法的一個問題。只是以爲我會爲這裏的任何人指出這個方法浪費了幾個小時。 http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller – kris

0

1,創建了UIButton的類作爲

2.redeclare inputview的子類,讀寫

@property (nonatomic, strong, readwrite) UIView *inputView; 

3.設定canBecomeFirstResponder爲YES

- (BOOL)canBecomeFirstResponder { 
return YES; 
} 

4.set inputview as datepicker

self.inputView = self.datePicker; 

5.設置UIResponder到firstResponder當你想

[self becomeFirstResponder]; 

5.you可以看到日期選擇幻燈片像鍵盤

相關問題