2012-12-03 49 views
1

我正在尋找一種方法來將多行UITextView添加到UIAlertView。我GOOGLE了很多,但我找不到一個工作解決方案。iOS:UIAlertView與多行UITextView

我使用的是iOS 5

或者是唯一可能與UIAlertView一個子類?

編輯:我需要一個多行輸入。

+3

根據'UIAlertView'官方文檔,你應該**不**子類'UIAlertView'。 –

回答

3

編輯UIAlertViews被蘋果標記爲惡作劇。所以它最好創建自己的自定義UIViewController,它看起來像一個警報視圖。

讓這個不是你的函數調用的警報,它加載新的視圖控制器

這是一個動畫爲您UIViewController,使之像一個典型的IOS AlertView

-(void)initialDelayEnded { 
self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001); 
self.view.alpha = 1.0; 
[UIView animateWithDuration:kTransitionDuration/1.5 animations:^{ 
    self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1); 
}completion:^(BOOL complete){ 
    [UIView animateWithDuration:kTransitionDuration/2 animations:^{ 
     self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9); 
    }completion:^(BOOL complete){ 
     [UIView animateWithDuration:kTransitionDuration/2 animations:^{ 
      self.view.transform = CGAffineTransformIdentity; 
     }]; 
    }]; 
}]; 
一個很好的例子

}

+0

謝謝,我會試試... – Maik639