IOS对话框UIAlertView
//修改弹出对话框的样式
alertView.alertViewStyle = UIAlertViewStylePlainTextInput; //根据索引获取指定的某个文本框
[alertView textFieldAtIndex :]
[alertView textFieldAtIndex :].text = her.name; //通过UIAlertView的代理来监听对话框中的按钮的点击事件
//实现UIAlertView的
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 代理方法
实例代码:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
CZHero *hero = self.heros[indexPath.row];
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitels:@"确定",nil]; alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[alertView textFieldAtIndex:].text = hero.name; //记录当前点击行的行号
alertView.tag = indexPath.row;
[alertView show]
} #pragma mark - alertView的代理方法
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger) buttonIndex{
//判断点击的是哪个按钮
if(buttonIndex ==){
//获取文本框中的数据
NSString *name = [alertView textFieldAtIndex:].text; //修改模型数据
//根据行号,获取当前点击行的模型数据
CZHero *hero = self.heros[alertView.tag];
hero.name = name; //重新刷新TableView数据
//重新刷新整个TableView,UITableView会重新向 datasource请求数据
//重新调用数据源方法
//[self.tableView reloadData];//不好重新刷新整个TableView //局部刷新
//创建一个indexPath对象
NSIndexPath *path = [NSIndexPath indexPathForRow:alertView.tag inSection:]; [self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationLeft];
}
}
IOS对话框UIAlertView的更多相关文章
- ios之UIAlertView
举例: UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Default Alert View"messa ...
- android 仿ios 对话框已封装成工具类
对话框 在android中是一种非经常见的交互提示用户的方式,可是非常多产品狗都叫我们这些做android的仿ios,搞的我们android程序猿非常苦逼,凭什么效果老是仿ios,有没有一点情怀,只是 ...
- 【iOS】UIAlertView 点击跳转事件
iOS 开发中,UIAlertView 经常用到.这里记录下曾用到的点击跳转事件. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@& ...
- iOS之UIAlertView的使用
UIAlertView: 1.普通使用: //普通的alert UIAlertView *av = [[UIAlertView alloc]initWithTitle:@"title&quo ...
- iOS - 提示信息 - UIAlertView、UIActionSheet、UIAlertController的实际应用
1.UIAlertView(屏幕中央弹出框)(不需要服从代理) UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@" ...
- IOS开发:UIAlertView使用
链接地址:http://www.2cto.com/kf/201307/231841.html UIAlertView是什么就不介绍了 1.基本用法 1 UIAlertView *view = [[UI ...
- IOS Using UIAlertView to show alerts
UIAlertView in other words, it's a dialog box. You want to show a message or ask user to confirm an ...
- iOS改变UIAlertView、UIActionSheet、UIAlertController系统字体颜色
废话不多说,直接上代码,效果是最好的说服力 1.改变UIAlertView字体颜色 [UIView appearance].tintColor = [UIColor greenColor]; 个人还是 ...
- IOS中UIAlertView(警告框)常用方法总结
一.初始化方法 - (instancetype)initWithTitle:(NSString *)title message:(NSString*)message delegate:(id /*&l ...
随机推荐
- [LeetCode] Decode String 题解
题目 题目 s = "3[a]2[bc]", return "aaabcbc". s = "3[a2[c]]", return " ...
- 十分钟搭建redis单机版 & java接口调用
本次单机版redis服务器搭建采用的包为redis-3.0.0.tar.gz,主要是记录下安装的心得,不喜勿喷! 一.搭建redis服务器单机版 1.上传redis-3.0.0.tar.gz到服务器上 ...
- Unity利用Sapi进行windows语音开发
软件中的语音技术主要包含两种:语音识别speech recognition和语音合成speech synthesis.一般地,开发者会因为技术实力和资金实力等各方面的问题无力完成专业的语音引擎,因此通 ...
- js 操作 cookie
js 操作 cookie 的方法如下: //设置cookie function setCookie(cname, cvalue, exdays) { var d = new Date(); d.set ...
- Confluence安装&破解&汉化
p.MsoNormal,li.MsoNormal,div.MsoNormal { margin: 0cm; margin-bottom: .0001pt; text-align: justify; f ...
- Adobe 系列软件通用破解方式(animate cc,Photoshop cc,Flash cc)等
破解之前准备工作: ①:安装好 试用版的 Adobe软件 ②:下载好破解软件: amtemu.v0.9.2-painter,下载地址:链接:http://pan.baidu.com/s/1nvNR74 ...
- 【转】ActionScript,Flash,Flash/Flex Builder,FlashPlayer,AIR,swf,swc,swz之间的区别
原文链接:http://zengrong.net/post/1295.htm ActionScript ActionScript通常简称为AS,它是Flash平台的语言.AS编写的程序,最终可以编译成 ...
- 老李分享:接电话之uiautomator 1
老李分享:接电话之uiautomator poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家咨询qq:9 ...
- 纯JS写动态分页样式效果
效果图如下: html: <body> <div> <table id="btnbox"> <tbody> <tr>&l ...
- 看Lucene源码必须知道的基本概念
终于有时间总结点Lucene,虽然是大周末的,已经感觉是对自己的奖励,毕竟只是喜欢,现在的工作中用不到的.自己看源码比较快,看英文原著的技术书也很快.都和语言有很大关系.虽然咱的技术不敢说是部门第一的 ...