2011-11-25 64 views
3

當我從4.1更新xcode到4.2後,UIAlertView的others按鈕無法正確顯示。 UIAlertView in xcode4.2XCode 4.2,UIAlertView和UIAlertButton?

當我調試時,重命名按鈕是UIAlertButton類,它的幀是frame =(0 0; 0 0); 你能幫忙嗎?

+1

這是真的一個UIAlertView,或一些子類或替換? – vikingosegundo

+1

你可以發佈提醒視圖設置代碼嗎? – jbat100

+0

根據HIG,我們不應該在AlertView –

回答

3

UIAlertView在被分類時表現得非常糟糕。蘋果似乎試圖讓它幾乎不可能繼承它。

但是有辦法解決這個問題。最好的一個:UIAlertView更換 - 一個視圖,重新創建UIAlertView的功能,而不是一個。 TSAlertView就是這樣一個替代品。

對於iOS 5,alertViewStyle可能對您有所幫助。

如需更多幫助或其他方法,您將不得不張貼您的代碼。

0

我認爲快速的方式來解決這個問題可能會喜歡它:

alert = [[YourSubclassOfUIAlertView alloc] initWithTitle:@"Change my name" 
message:@"From now on, I want to know as:\n\n" /* Add \n\n to expand the UIAlertView space */ delegate:..... 

BTW:@vikingosegundo是正確的。 你會發現這篇文章有用:Customizing UIAlertView