2015-09-25 61 views
1

我從這裏實現自定義的iOS AlertView:https://github.com/wimagguc/ios-custom-alertview使用自定義iOS AlertView,按鈕關閉警報?

和繼承人,我怎麼實現它:

CustomIOSAlertView *alertView = [[CustomIOSAlertView alloc] init]; 
     [alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"Cancel", @"Next", nil]]; 
     [alertView setUseMotionEffects:true]; 

     [alertView setContainerView:view]; 
     [alertView show];  

所以,問題是,我沒有叫alertView close但它在任任意點擊關閉按鈕,這不是我想要的

任何人都知道此修復?

回答

0

默認情況下,當您單擊此alertView中的任何按鈕時,alertView將消失。

+0

我該如何讓它不是默認? – farhan

+0

在您的自定義AlertView中,您需要更改庫的本機代碼。我在CustomIOSAlertView.m中找到它 - (void)customIOS7dialogBu​​ttonTouchUpInside :(CustomIOSAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@「Button Clicked!%d,%d」,(int)buttonIndex, [alertView標籤]); [self close]; } – nynohu