123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- #import "RecordList.h"
- #import "CLCell.h"
- #import "PostTopicVC.h"
- @interface RecordList ()<UITableViewDataSource,UITableViewDelegate>
- {
- NSArray* titles,*tint;
- }
- @end
- @implementation RecordList
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self myInit];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- }
- #pragma mark -
- -(void)myInit
- {
- [self configNavigationBar];
- [self.view setBackgroundColor:[UIColor whiteColor]];
- [self setTitle:@"我要记录"];
-
- UITableView* tv = [[UITableView alloc] initWithFrame:kFrame];
- tv.height -= kNavOffSet;
- [tv setDelegate:self];
- [tv setDataSource:self];
- [self.view addSubview:tv];
- tv.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
-
- UILabel* label = [[UILabel alloc ] initWithFrame:CGRectMake(0, 0, kSize.width, 40)];
- [label setTextAlignment:NSTextAlignmentCenter];
- [label setText:@"记下今天做了什么" ];
- [label setFont:[UIFont scaleSize:NormalFont]];
- [label setTextColor:subTitleColor];
- CGFloat x = kSize.width/2.0 - [label.text sizeForFont:NormalFont].width/2.0 - 30;
- UIImageView* iv = [[UIImageView alloc] initWithFrame:CGRectMake(x, 10, 20, 20)];
- [iv setImage:[UIImage imageNamed:@"img03pen.png"] ];
- [label addSubview:iv];
- [label addSelfViewWithRect:CGRectMake(0, 39, kSize.width, 1) Color:KlineColor];
-
- tv.tableHeaderView = label;
-
- titles = @[@"科目一法规培训",@"科目一考试",@"科目二场地练习",@"科目二考试",@"科目三实路练习",
- @"科目三考试",@"科目四考试",@"拿驾照啦"];
- tint = @[@"",@"",@"",@"",
- defGreen,[UIColor redColor],@"",@"",];
- }
- -(UIImage*)imageAtRow:(NSInteger)row
- {
- UIImage * image;
- NSArray* arr = @[@"subject1_title_press.png",@"guide_icon1.png",@"subject2_title_press.png",@"guide_icon2.png",
- @"guide_icon3.png",@"guide_icon6.png",@"guide_icon4.png",@"subject4_title_press.png"];
- image = [UIImage imageNamed:arr[row]];
-
- if ( 4 == row) {
- image = [image tint:defGreen];
- }
- if (5 == row) {
- image = [image tint:[UIColor redColor]];
- }
- return image;;
- }
- #pragma mark -
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return titles.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- CLCell* cell = [CLCell cellForTableView:tableView Style:UITableViewCellStyleDefault];
- [cell.textLabel setText:titles[indexPath.row]];
- [cell.imageView setImage:[self imageAtRow:indexPath.row]];
- [cell.textLabel setTextColor:contentTextColor];
- [cell.textLabel setFont:[UIFont scaleSize:13]];
- return cell;
- }
- -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- PostTopicVC* vc = [PostTopicVC new];
- vc.type = @"2";
-
- if (indexPath.row < 2)
- {
- vc.childID = @"1";
- }
- else if (indexPath.row < 4)
- {
- vc.childID = @"2";
- }
- else if (indexPath.row < 6)
- {
- vc.childID = @"3";
- }
- else if (indexPath.row < 7)
- {
- vc.childID = @"5";
- }
- else
- {
- vc.childID = @"6";
- }
-
-
- NSString* str = [NSString stringWithFormat:@"%d",(int)indexPath.row+10];
- // NSLog(@"groupId->%@",str);
- vc.groupId = str;
- [self navPushHideTabbarToVC:vc];
- }
- @end
|