猎豆优选

LDCommunityViewController.m 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // LDCommunityViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/5/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LDCommunityViewController.h"
  9. #import "LDCommunityLeftController.h"
  10. #import "LDCommunityRightController.h"
  11. #import "MLMSegmentHead.h"
  12. #import "MLMSegmentManager.h"
  13. @interface LDCommunityViewController ()
  14. {
  15. NSInteger _page;
  16. }
  17. @property (nonatomic, strong) MLMSegmentHead *titleView;
  18. @property (nonatomic, strong) MLMSegmentScroll *segScroll;
  19. @end
  20. @implementation LDCommunityViewController
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. [self configNavigationBar];
  24. [self creatSwitchView];
  25. [self addReloadObser];
  26. }
  27. - (void)addReloadObser {
  28. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshData) name:ChangeSex object:nil];
  29. }
  30. - (void)refreshData {
  31. [self creatSwitchView];
  32. }
  33. - (void)configNavigationBar{
  34. [self.navigationBar setNavTitle:@"今日爆款"];
  35. self.view.backgroundColor = [UIColor whiteColor];
  36. self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor];
  37. self.navigationBar.backgroundColor = [UIColor changeColor];
  38. }
  39. -(void)viewWillAppear:(BOOL)animated{
  40. [super viewWillAppear:animated];
  41. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  42. [SVProgressHUD dismiss];
  43. }
  44. -(void)viewDidDisappear:(BOOL)animated{
  45. [super viewDidDisappear:animated];
  46. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
  47. }
  48. -(void)viewDidAppear:(BOOL)animated{
  49. [super viewDidAppear:animated];
  50. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  51. }
  52. - (void)creatSwitchView {
  53. self.view.backgroundColor = [UIColor backgroudColor];
  54. NSMutableArray *list = [NSMutableArray array];
  55. // LDCommunityRightController *seg1 = [[LDCommunityRightController alloc] init];
  56. // [list addObject:seg1];
  57. LDCommunityLeftController *seg2 = [[LDCommunityLeftController alloc] init];
  58. [list addObject:seg2];
  59. self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, ChildTableViewHeight+40) vcOrViews:list];
  60. self.segScroll.loadAll = YES;
  61. [MLMSegmentManager associateHead:nil withScroll:self.segScroll completion:^{
  62. [self.view addSubview:self.segScroll];
  63. }];
  64. }
  65. - (void)didReceiveMemoryWarning {
  66. [super didReceiveMemoryWarning];
  67. // Dispose of any resources that can be recreated.
  68. }
  69. @end