UIAlertView点击按钮不会销毁自身View
2015-04-15 10:30
375 查看
子类化UIAlertView,复写方法
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;
复写方法的时候,记得不要调用父类的方法。
参考自:http://stackoverflow.com/questions/2051402/is-it-possible-to-not-dismiss-a-uialertview/2051969#2051969
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;
/// UIAlertView subclass which can't be dismissed when buttons clicked. @interface FixAlertView : UIAlertView @end
@implementation FixAlertView - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated { // [super dismissWithClickedButtonIndex:buttonIndex animated:animated]; return; } @end
复写方法的时候,记得不要调用父类的方法。
参考自:http://stackoverflow.com/questions/2051402/is-it-possible-to-not-dismiss-a-uialertview/2051969#2051969
相关文章推荐
- IOS-监听UIAlertView按钮的点击事件
- 为UIAlertView上的按钮添加方法,需要重写协议中对话框按钮点击事件方法
- 问题: alerview的按钮点击时,某些view动画不会执行
- 将UIAlertView的按钮点击代理方式改为Block形式
- UIAlertView 按钮设置可点或者不可点击
- 解决通过UIAlertView按钮点击事件pop回上级页面键盘会响应问题
- UIAlertView 点击按钮后控制其是否消失
- 系统提示 点击其他关闭 alert iOS之UIAlertView点击窗口之外区域关闭
- 如何给navigationView中的按钮添加点击事件
- 3.Textview和Button的使用:点击按钮,返回点击次数
- Android-点击WebView中的按钮,关闭当前activity
- iOS学习之动态添加Button和监听UIAlertView按钮
- 点击navigationitem上的按钮,弹出view,类似弹出菜单
- 高仿微信主界面:ViewPage+Fragment 不预加载Fragment 也不会销毁Fragment
- Android 使用ViewPager和RadioGroup配合Fragment实现标签页,可点击按钮切换、滑动切换。
- IOS】自定义UIAlertView样式,实现可替换背景和按钮 此博文包含图片此博文包含视频 (2012-10-24 10:23:25)
- 点击编辑按钮 选择并且删除recyclerview的item条目操作
- android按钮点击——implements View.OnClickListener
- android之View坐标系(view获取自身坐标的方法和点击事件中坐标的获取)
- iOS高级开发——CollectionView的cell中按钮的点击实现