在section上面设置相应的时间
来源:互联网 发布:乐视视频客户端mac 编辑:程序博客网 时间:2024/05/18 12:32
在每一个section的title上面设置相应的获取数据的时间
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
//获取相应的time
NSDate * senddate=[NSDate date];
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
[dateformatter setDateFormat:@"HH:mm"];
NSString * locationString=[dateformatter stringFromDate:senddate];
//获取相应的日期
NSCalendar * cal=[NSCalendar currentCalendar];
NSUInteger unitFlags=NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit;
NSDateComponents * conponent= [cal components:unitFlags fromDate:senddate];
NSInteger year=[conponent year];
NSInteger month=[conponent month];
NSInteger day=[conponent day];
NSString * nsDateString= [NSString stringWithFormat:@"%4d年%2d月%2d日",year,month,day];
//把对应的日期时间写在section上面,
return [NSString stringWithFormat:@"日期:%@,时间:%@",locationString,nsDateString];
[dateformatter release];
}
相对应的如果想要对sectionheader进行设置的话,要定义tableview的属性,除此之外还有对应的行高
- 在section上面设置相应的时间
- UITableView section header 显示在最上面
- 在outlook上面的邮箱设置
- mfc在主框架CmainFrame中相应对话框上面控件的事件
- iOS 在cell上面查找你设置的控件
- UIButton 设置 button上面的图片在上面,title在下面
- 设置section的头部间距
- UITaableView的section间隔设置
- 以当前的时间命名文件名,并放在相应的目录下。
- 创建预定计划,找出目前在系统上面登陆的用户与登陆时间
- 动态添加ComboBox,并在触发change时间后取出相应的值
- Calendar在时间上加上任意天数(正/负),就可以得到相应的日期
- 在window 7上面,IIS的使用及网站的设置
- 关于电脑上面的时间利用
- 修改linux上面的显示时间
- 修改linux上面时间的方法
- 自定义扩展名的文件在eclipse中如何设置相应的插件进行查看
- 如果Cell设置了 titlelabel Titlelabel会覆盖加在cell上面的其他控件
- oracle物化视图
- 创建大小100*100矩阵,所有数值置零,并画半径为50,中心点为(50,50)的圆
- 认识Class
- [自学问题总结] java中的对象创建过程
- 全景图2.0 DEMO 下载 PanoramaGL
- 在section上面设置相应的时间
- ios 单元测试-耗时测试
- 使用URL Rewrite实现网站伪静态
- 关于信号未决与阻塞
- 13-php中的错误的处理2
- VS2010编译thrift
- unity模型动画无法进行模式设置
- Android ADB server didn't ACK
- 人社部官员:今年预计超300万大学生难就业