杂记
2011-07-26 12:14
134 查看
tableview 的初始化: style:UITableViewStyleGrouped];
tableview = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] bounds] style:UITableViewStyleGrouped];
tableview.delegate = self;
tableview.dataSource = self;
tableview.scrollEnabled = NO;//是否支持滑动。
tableview.backgroundColor = [UIColor clearColor];
tableview.separatorColor = [UIColor grayColor];//分割线的颜色
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"新分组" message:@" \n "
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil];
UITextField * groupname = [[UITextField alloc] initWithFrame:CGRectMake(30, 50, 220, 30)];
groupname.borderStyle = UITextBorderStyleRoundedRect;
[groupname setBackgroundColor:[UIColor clearColor]];
[groupname becomeFirstResponder];//将软键盘调出来
[alert addSubview:groupname];
[alert show];
[alert release];
软键盘的调出与消失可由UITextFiled的委托方法来处理。
消息的使用:
发送消息
[[NSNotificationCenter defaultCenter] postNotificationName:aName object:nil userInfo:aUserInfo];
注册一个消息:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(changetheme) //消息响应函数
name:ThemeFlag//消息名称
object:nil];
注销一个消息:
[[NSNotificationCenter defaultCenter] removeObserver:self
name:ThemeFlag //消息名称
object:nil];
tableview = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] bounds] style:UITableViewStyleGrouped];
tableview.delegate = self;
tableview.dataSource = self;
tableview.scrollEnabled = NO;//是否支持滑动。
tableview.backgroundColor = [UIColor clearColor];
tableview.separatorColor = [UIColor grayColor];//分割线的颜色
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"新分组" message:@" \n "
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil];
UITextField * groupname = [[UITextField alloc] initWithFrame:CGRectMake(30, 50, 220, 30)];
groupname.borderStyle = UITextBorderStyleRoundedRect;
[groupname setBackgroundColor:[UIColor clearColor]];
[groupname becomeFirstResponder];//将软键盘调出来
[alert addSubview:groupname];
[alert show];
[alert release];
软键盘的调出与消失可由UITextFiled的委托方法来处理。
消息的使用:
发送消息
[[NSNotificationCenter defaultCenter] postNotificationName:aName object:nil userInfo:aUserInfo];
注册一个消息:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(changetheme) //消息响应函数
name:ThemeFlag//消息名称
object:nil];
注销一个消息:
[[NSNotificationCenter defaultCenter] removeObserver:self
name:ThemeFlag //消息名称
object:nil];
相关文章推荐
- 点滴杂记
- 12.Oracle杂记——Oracle等待事件性能监控脚本
- Python起步之编写网页初探杂记
- android杂记-三方依赖(清单合并失败,aar)
- Python学习零散杂记(2017-10-26)
- 17.Oracle杂记——数据字典dba_ts_quotas
- 32.Oracle杂记——Oracle常用动态视图v$sqlarea
- 46.Oracle杂记——Oracle常用动态视图v$session_event
- 杂记
- git杂记:撤销
- 杂记-java集合之collection结构
- Python学习零散杂记(2017-11-28)
- 一篇杂记
- Cassandra杂记10-大话Cassandra数据模型
- SCRAPY_part7_杂记
- CSS3(杂记)
- 商城系统下单库存管控系列杂记(二)(并发安全和性能部分延伸)
- 杂记--《python学习手册(第四版)》
- 杂记——请多给18岁一些空间
- Android学习杂记(四):Android应用遭遇错误导致崩溃之后自动重启