您的位置:首页 > 产品设计 > UI/UE

UIAlertView的代理方法

2013-10-12 16:59 239 查看
在iPad 应用中, 判断用户是否登录 , 如果未登录 , 弹出警示框 , 带有登录按钮的, 在

- (void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex;

这个方法中调用登录方法 , 弹出的登录窗口瞬时消失 。 这是什么问题呢 ?

或许这个登录的弹出界面,跟UIAlertView的动画冲突了。

UIAlertView的代理方法查了一下

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;这个方法是当View的隐藏动画结束的时候进行回调;于是用了这个,呵呵,居然能看到效果了,嗯,多想想,多联想
还是有好处的!!!

还有几个回调:

- (void)alertViewCancel:(UIAlertView *)alertView;

//当用户按下HOME键的时候,回调此方法,用户点击Cancel按钮的时候不会回调此方法

- (void)willPresentAlertView:(UIAlertView *)alertView//开始显示View的动画之前进行回调

- (void)didPresentAlertView:(UIAlertView *)alertView//显示动画完成之后进行回调

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex//将要开始View隐藏动画的时候进行回调

- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView;//编辑任何默认的字段添加的风格之后调用
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: