1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // LPBaseVC.m
- // LPNavPageVCTest
- //
- // Created by LPDev on 16/4/19.
- // Copyright © 2016年 anonymous. All rights reserved.
- //
- #import "LPBaseVC.h"
- @interface LPBaseVC ()
- @property (nonatomic, weak) UIImageView * contentLineImageView;
- @end
- @implementation LPBaseVC
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.contentLineImageView = [self findHairlineImageViewUnder:self.navigationController.navigationBar];
- }
- - (void)viewWillAppear:(BOOL)animated {
-
- [super viewWillAppear:animated];
-
- _contentLineImageView.hidden = YES;
- }
- - (void)viewWillDisappear:(BOOL)animated {
-
- [super viewWillDisappear:animated];
-
- _contentLineImageView.hidden = NO;
- }
- // 隐藏导航栏下面的那直线
- - (UIImageView *)findHairlineImageViewUnder:(UIView *)view {
-
- if ([view isKindOfClass:UIImageView.class] && view.bounds.size.height <= 1.0) {
-
- return (UIImageView *)view;
- }
-
- for (UIView *subview in view.subviews) {
-
- UIImageView *imageView = [self findHairlineImageViewUnder:subview];
-
- if (imageView) {
-
- return imageView;
- }
- }
-
- return nil;
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|