【iOS】UIAlertView 点击跳转事件

iOS 开发中,UIAlertView 经常用到。这里记录下曾用到的点击跳转事件。

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示"
                                                message:@"退出"
                                               delegate:self
                                      cancelButtonTitle:@"确认"
                                      otherButtonTitles:nil];
if ([@"请记住新密码" isEqualToString:result.msg]) {
    alert.tag=1;
}
[alert show];

UIAlertView 的点击事件(点击后跳转到其他页面):

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (alertView.tag == 1) {
        [self.navigationController popViewControllerAnimated:YES];
    }
}
时间: 2024-08-02 14:48:14

【iOS】UIAlertView 点击跳转事件的相关文章

iOS开发 点击跳转到App Store 或者 点击按钮去评价

//跳转到应用页面 NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%d",appid];  [[UIApplication sharedApplication] openURL:[NSURL urlWithString:str]]; //跳转到评价页面 NSString *str = [NSString stringWithFormat: @"itms-apps://

阻止a标签点击跳转刷新

这是一个所有做前端都会遇到的问题: 布局是这样的,有一个宽高100px背景为红的div,默认是display:none 隐藏状态: 给两个a标签绑定的同一个click事件,改变div的display为block:让其显示: 但是第一个a标签点击后div刚出现立马就没有了:第二个a标签点击后div会正常显示: 初遇到这个问题的时候,马虎点的童鞋可能要迷茫很久都找不到原因,而细心点就会发现是a标签点击后页面刷新了,所以闪过: 一部分童鞋始终不知道怎么阻止a标签跳转,于是就换用其他标签,避免给a标签添

IOS开发-点击View取消键盘输入

要想在一个TextField等输入框中取消输入,有几个办法,第一个是在键盘添加按钮,第二个就是通过判断然后取消键盘的输入了. 下面讲第二个 写一个方法并实现 // .h文件 - (IBAction)cancelInput:(id)sender; // .m文件 - (void)cancelInput:(id)sender { [TextField1 resignFirstResponder]; [TextField2 resignFirstResponder]; [TextView resign

Setting 之dashboard 点击跳转流程

设置的主界面的可以通过修改xml中的dashboard_categaries.xml 文件实现,在DashboardSummary.java 文件中的rebuildUI()方法中将xml对应的实体类转换成对应的view,具体细节可以看设置源码. 一,dashboard_categaries中定义节点的样式: 1 <!-- Wifi --> 2 <dashboard-tile 3 android:id="@+id/wifi_settings" 4 android:fra

启动页分为4页,最后一页有一个按钮,点击跳转到主页面

代码效果为:启动页分为4页,最后一页有一个按钮,点击跳转到主页面. 上代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UIScrollView * sv = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; sv.contentSize = CGSizeMake(320

使用JS或jQuery模拟鼠标点击a标签事件代码

原文 使用JS或jQuery模拟鼠标点击a标签事件代码 这篇文章主要介绍了使用JS或jQuery模拟鼠标点击a标签事件代码,需要的朋友可以参考下 <a id="alink" href="abc.aspx" style="visibility: hidden;">下一步</a> $("#alink").click(); // 触发了a标签的点击事件,但是没有触发页面跳转 document.getEleme

小程序点击跳转外部链接 微信小程序提示:不支持打开非业务域名怎么办 使用web-view 配置业务域名

小程序点击跳转外部页面 1.index.wxml  添加点击事件   标签可以是小程序支持的 <!-- 邀请好友 --> <cover-image src='/img/invitation.png' class='img-invitation' bindtap='invitation'></cover-image> 2.index.js   添加事件 invitation: function () { var that = this; wx.showModal({ ti

IOS系统中点击失效

IOS系统中点击失效 问题 当委托给一个元素添加click事件时,如果事件是委托到 document 或 body 上,并且委托的元素是默认不可点击的(如 div, span 等),此时 click 事件会失效. 例如: //加载更多 $('body').on('click','.showMoreData',function () { }) 问题原因 React attaches event listeners to the document. iOS doesn't fire click ev

ios中iframe的scroll滚动事件替代方法

在公众号的开发中,遇到ios中iframe的scroll滚动事件失效,在此做下记录. 因为接口获取的数据必须放在iframe中展示,滚动到底部按钮变亮,如图: 代码如下: <!DOCTYPE html> <html> <head> <title>贷款合同</title> <% include ../include/header.html %> </head> <body style="background: