JSXQDetailViewController.m 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. //
  2. // JSXQDetailViewController.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/8/17.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "JSXQDetailViewController.h"
  9. #import "JSXQdetailCell.h"
  10. @interface JSXQDetailViewController ()<UITableViewDelegate,UITableViewDataSource>{
  11. UITableView *newtableView;
  12. NSMutableArray *dataArray;
  13. }
  14. @end
  15. @implementation JSXQDetailViewController
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. [self setNavTitle:@"需求详情"];
  19. [self dataInitialization];
  20. [self loadsView];
  21. // Do any additional setup after loading the view.
  22. }
  23. - (void)dataInitialization{
  24. dataArray = NewMutableArrayInit;
  25. [dataArray addObject:@"1"];
  26. [dataArray addObject:@"1"];
  27. [dataArray addObject:@"1"];
  28. [dataArray addObject:@"1"];
  29. [dataArray addObject:@"1"];
  30. }
  31. #pragma mark ----加载界面
  32. - (void)loadsView{
  33. [self.view addSubview:newtableView = [NewControlPackage tableViewInitWithFrame:CGRectMake(0, NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-(NavHeader+45)) backgroundColor:NewGroupTableViewBackgroundColor style:1 delegate:self dataSource:self showsHorizontalScrollIndicator:NO showsVerticalScrollIndicator:NO hidden:NO tag:100 userInteractionEnabled:YES]];
  34. newtableView.separatorStyle = NO;
  35. UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT-45, SCREEN_WIDTH, 45)];
  36. view.backgroundColor = [UIColor colorWithString:@"#E3E3E3"];
  37. [self.view addSubview:view];
  38. UIButton *bianjiBT = [UIButton new];
  39. bianjiBT.frame = CGRectMake(SCREEN_WIDTH-fitScreenWidth(150), 0, fitScreenWidth(150), 45);
  40. [bianjiBT setTitle:@"立即办理" forState:UIControlStateNormal];
  41. bianjiBT.titleLabel.font = NewFont(fitScreenWidth(18));
  42. [bianjiBT setTitleColor:NewWhiteColor forState:UIControlStateNormal];
  43. [bianjiBT setBackgroundColor:NewButtonColor];
  44. [view addSubview:bianjiBT];
  45. UIButton *scBT = [UIButton new];
  46. [scBT setBackgroundColor:NewRedColor];
  47. [view addSubview:scBT];
  48. scBT.sd_layout
  49. .centerYEqualToView(view)
  50. .widthIs(15)
  51. .heightIs(15)
  52. .leftSpaceToView(view, 15);
  53. UIButton *scBTff = [UIButton new];
  54. [scBTff setTitle:@"收藏" forState:UIControlStateNormal];
  55. scBTff.titleLabel.font = NewFont(14);
  56. [scBTff setTitleColor:[UIColor colorWithString:@"#6C6C6C"] forState:UIControlStateNormal];
  57. [view addSubview:scBTff];
  58. scBTff.sd_layout
  59. .centerYEqualToView(view)
  60. .widthIs(30)
  61. .heightIs(15)
  62. .leftSpaceToView(scBT, 10);
  63. }
  64. #pragma mark-------------------------UITableView------------------------------------
  65. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  66. {
  67. return 1;
  68. }
  69. //返回每段行数
  70. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  71. {
  72. return 1;
  73. }
  74. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  75. {
  76. static NSString *Cell = @"Cell";
  77. JSXQdetailCell * cell = [tableView dequeueReusableCellWithIdentifier:Cell];
  78. if (cell == nil) {
  79. cell = [[JSXQdetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell];
  80. }
  81. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//(这种是没有点击后的阴影效果)
  82. cell.accessoryType = UITableViewCellAccessoryNone;
  83. return cell;
  84. }
  85. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  86. {
  87. return SCREEN_HEIGHT-NavHeader-45;
  88. }
  89. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  90. // NewprojectDetailViewController *vc = [[NewprojectDetailViewController alloc] init];
  91. // NewPushViewController(vc);
  92. }
  93. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  94. return CGFLOAT_MIN;
  95. }
  96. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  97. return CGFLOAT_MIN;
  98. }
  99. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  100. return [[UIView alloc] init];
  101. }
  102. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
  103. return [[UIView alloc] init];
  104. }
  105. - (void)didReceiveMemoryWarning {
  106. [super didReceiveMemoryWarning];
  107. // Dispose of any resources that can be recreated.
  108. }
  109. /*
  110. #pragma mark - Navigation
  111. // In a storyboard-based application, you will often want to do a little preparation before navigation
  112. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  113. // Get the new view controller using [segue destinationViewController].
  114. // Pass the selected object to the new view controller.
  115. }
  116. */
  117. @end